From b36782ec5fed77fd3f185c699f2d8adff980d01e Mon Sep 17 00:00:00 2001 From: ashwinishinde Date: Mon, 30 Mar 2015 11:15:28 +0530 Subject: Subject: Display Notifications on Header for Answer's and Comment's .. Red color Description: 1) notification for answers and comments. --- forums/settings.py | 2 +- forums/views.py | 9 +++++---- static/website/templates/base.html | 30 ++++++++++++++++++------------ website/views.py | 5 +++++ 4 files changed, 29 insertions(+), 17 deletions(-) diff --git a/forums/settings.py b/forums/settings.py index 63ec9c5..b556319 100644 --- a/forums/settings.py +++ b/forums/settings.py @@ -68,7 +68,7 @@ MEDIA_URL = '' # Don't put anything in this directory yourself; store your static files # in apps' "static/" subdirectories and in STATICFILES_DIRS. # Example: "/var/www/example.com/static/" -STATIC_ROOT = '' +STATIC_ROOT = '/static/' # URL prefix for static files. # Example: "http://example.com/static/", "http://static.example.com/" diff --git a/forums/views.py b/forums/views.py index 3e82a90..e757ab9 100644 --- a/forums/views.py +++ b/forums/views.py @@ -57,7 +57,7 @@ def account_register(request): def send_registration_confirmation(user): p = Profile.objects.get(user=user) - #user.email = "k.sanmugam2@gmail.com" + user.email = "ashwinids03@gmail.com" # Sending email when an answer is posted subject = 'Account Active Notification' message = """Dear {0}, @@ -65,7 +65,7 @@ def send_registration_confirmation(user): {2} Regards, Admin - Spoken Tutorials + FOSSEE forum IIT Bombay. """.format( user.username, @@ -73,15 +73,16 @@ def send_registration_confirmation(user): "http://spoken-tutorial.org/accounts/confirm/" + str(p.confirmation_code) + "/" + user.username ) email = EmailMultiAlternatives( - subject, message, 'administrator@spoken-tutorial.org', + subject, message, 'sysads@fossee.in', to = [user.email], bcc = [], cc = [], headers={'Reply-To': 'no-replay@spoken-tutorial.org', "Content-type":"text/html;charset=iso-8859-1"} ) - #email.attach_alternative(message, "text/html") + email.attach_alternative(message, "text/html") try: result = email.send(fail_silently=False) except: pass + def user_login(request): if request.user.is_anonymous(): diff --git a/static/website/templates/base.html b/static/website/templates/base.html index a2f2534..b174d69 100644 --- a/static/website/templates/base.html +++ b/static/website/templates/base.html @@ -56,27 +56,33 @@ {% if user.is_authenticated %} -