docker and docker compose

This commit is contained in:
asamihassan 2022-02-20 23:11:15 +05:00
commit 73fc171761
18 changed files with 296 additions and 25 deletions

View file

@ -5,6 +5,12 @@ from .models import GithubCrawler
import requests
from bs4 import BeautifulSoup
import datetime
from django.core.mail import send_mail
import os
def month_converter(month):
months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
@ -44,7 +50,15 @@ def GithubPage(request):
if githubobj.last_pushed_number:
if githubobj.last_pushed_number < last_pushed_number_thing:
print("send email and notify here")
message = '"From GitCrawler: '+ githubobj.url + ' updated Commit: ' + str(last_pushed_number_thing)+ '"'
os.system('notipy send ' + str(message))
send_mail(
githubobj.url,
'Commit '+ str (last_pushed_number_thing),
'from@example.com',
['to@example.com'],
fail_silently=False,
)
githubobj.last_pushed_number = last_pushed_number_thing
githubobj.last_pushed = last_pushed_thing