From e88e9940b8c7bad21d9661181410d1c8e6d69572 Mon Sep 17 00:00:00 2001 From: Sanj Date: Wed, 3 Aug 2011 21:27:53 +0530 Subject: [PATCH] registration email, conditional for login / logout in template --- itf/frontpage/views.py | 9 +++------ itf/settings.py | 4 +++- itf/templates/noel/base.html | 10 ++++++++-- itf/templates/registration/logout.html | 4 ++++ 4 files changed, 18 insertions(+), 9 deletions(-) create mode 100644 itf/templates/registration/logout.html diff --git a/itf/frontpage/views.py b/itf/frontpage/views.py index 4016eb4..29f1413 100644 --- a/itf/frontpage/views.py +++ b/itf/frontpage/views.py @@ -3,7 +3,7 @@ from django.shortcuts import render_to_response from models import * from settings import TWITTER_ID import twitter - +from django.template import RequestContext def index(request): tApi = twitter.Api() @@ -17,11 +17,8 @@ def index(request): 'items': [{'name': item.name, 'url': item.url} for item in m.menuitem_set.all()] } menus.append(d) - return render_to_response("noel/index.html", { + return render_to_response("noel/index.html", RequestContext(request, { 'tweets': statuses[0:5], 'boxes': boxes, 'menus': menus - }) - - - + })) diff --git a/itf/settings.py b/itf/settings.py index 9e88175..fbc44ba 100644 --- a/itf/settings.py +++ b/itf/settings.py @@ -23,6 +23,8 @@ CKEDITOR_UPLOAD_PATH = join(PROJECT_PATH, "static/upload/images/") AUTH_PROFILE_MODULE = "profiles.Person" +LOGIN_REDIRECT_URL = "/t/" + ADMINS = ( # ('Your Name', 'your_email@domain.com'), ) @@ -38,7 +40,7 @@ DATABASE_PASSWORD = '' # Not used with sqlite3. DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. -TWITTER_ID = "sachin_rt" +TWITTER_ID = "indtheatreforum" CACHES = { 'default': { diff --git a/itf/templates/noel/base.html b/itf/templates/noel/base.html index 68d49d9..885b099 100644 --- a/itf/templates/noel/base.html +++ b/itf/templates/noel/base.html @@ -70,8 +70,14 @@ diff --git a/itf/templates/registration/logout.html b/itf/templates/registration/logout.html new file mode 100644 index 0000000..d12df4a --- /dev/null +++ b/itf/templates/registration/logout.html @@ -0,0 +1,4 @@ +{% extends 'registration/register_base.html' %} +{% block reg_content %} + Logged out. Thanks for using the website. Have a nice day! +{% endblock %}