registration email, conditional for login / logout in template

This commit is contained in:
Sanj 2011-08-03 21:27:53 +05:30
parent f8820abf55
commit e88e9940b8
4 changed files with 18 additions and 9 deletions

View File

@ -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
})
}))

View File

@ -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': {

View File

@ -70,8 +70,14 @@
</ul>
<ul id="loginMenu">
<li><a href="">Login</a></li>
<li><a href="">Register</a></li>
{% if user.is_authenticated %}
<li><a href="/accounts/logout">Logout</a></li>
{% else %}
<li><a href="/accounts/login">Login</a></li>
<li><a href="/accounts/register">Register</a></li>
{% endif %}
<li><a href="">Contact Us</a></li>
</ul>
</div>

View File

@ -0,0 +1,4 @@
{% extends 'registration/register_base.html' %}
{% block reg_content %}
Logged out. Thanks for using the website. Have a nice day!
{% endblock %}