# HG changeset patch # User anoop # Date 1275572174 -19800 # Node ID 212fcba4459e591c53c72d308cefa396d62c6d28 # Parent 30baf3c635c54372ac3c2fbd46764d637a1446f0 changed the app to work with apache + added base.html, and did needed changes. diff -r 30baf3c635c5 -r 212fcba4459e .hgignore --- a/.hgignore Sat May 29 19:35:49 2010 +0530 +++ b/.hgignore Thu Jun 03 19:06:14 2010 +0530 @@ -2,3 +2,4 @@ *.pyc *.db *.swp +*.*~ diff -r 30baf3c635c5 -r 212fcba4459e sdi/site/urls.py --- a/sdi/site/urls.py Sat May 29 19:35:49 2010 +0530 +++ b/sdi/site/urls.py Thu Jun 03 19:06:14 2010 +0530 @@ -1,10 +1,10 @@ from django.conf.urls.defaults import * from sage_days.settings import ADMIN_URL_PREFIX as aup -from sage_days.sdi.views import register, reg_complete, list_stats +from sage_days.sdi.views import register, reg_complete, list_stats, homepage urlpatterns = patterns('', - (r'^register/$', register), + (r'^register/$', register), (r'^complete/$', reg_complete), (r'%s/stats/$'%aup, list_stats), ) diff -r 30baf3c635c5 -r 212fcba4459e sdi/views.py --- a/sdi/views.py Sat May 29 19:35:49 2010 +0530 +++ b/sdi/views.py Thu Jun 03 19:06:14 2010 +0530 @@ -1,4 +1,6 @@ from django.shortcuts import render_to_response, redirect +from django.http import HttpResponse + from sage_days.sdi.models import Registrant from sage_days.sdi.forms import RegisterForm, SearchForm @@ -11,7 +13,7 @@ form = RegisterForm(request.POST) if form.is_valid(): form.save() - return redirect("/registration/complete") + return redirect("/sage_days/registration/complete") else: return render_to_response("register.html", {"form":form}) else: @@ -70,3 +72,7 @@ else: form = SearchForm() return render_to_response("list_stats.html", {"form":form}) + +def homepage(request): + return render_to_response("index.html") + diff -r 30baf3c635c5 -r 212fcba4459e settings.py --- a/settings.py Sat May 29 19:35:49 2010 +0530 +++ b/settings.py Thu Jun 03 19:06:14 2010 +0530 @@ -1,16 +1,16 @@ # Django settings for sage_days project. -DEBUG = True +DEBUG = False TEMPLATE_DEBUG = DEBUG -ADMINS = ( +ADMINS = (('Anoop Jacob Thomas','anoop@fossee.in') # ('Your Name', 'your_email@domain.com'), ) MANAGERS = ADMINS DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. -DATABASE_NAME = 'sage.db' # Or path to database file if using sqlite3. +DATABASE_NAME = '/var/www/html/sage_days/sage.db' # Or path to database file if using sqlite3. DATABASE_USER = '' # Not used with sqlite3. DATABASE_PASSWORD = '' # Not used with sqlite3. DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. @@ -69,7 +69,7 @@ # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. - './templates', + '/var/www/html/sage_days/templates', ) INSTALLED_APPS = ( @@ -81,5 +81,5 @@ 'sage_days.sdi', ) -APACHE_URL_PREFIX = "/sagedays/" +APACHE_URL_PREFIX = "sage_days" ADMIN_URL_PREFIX = "ditchax" diff -r 30baf3c635c5 -r 212fcba4459e templates/list_stats.html --- a/templates/list_stats.html Sat May 29 19:35:49 2010 +0530 +++ b/templates/list_stats.html Thu Jun 03 19:06:14 2010 +0530 @@ -1,5 +1,5 @@ - - +{% extends 'base.html' %} +{% block content %}
- +{% endblock %} diff -r 30baf3c635c5 -r 212fcba4459e urls.py --- a/urls.py Sat May 29 19:35:49 2010 +0530 +++ b/urls.py Thu Jun 03 19:06:14 2010 +0530 @@ -4,7 +4,7 @@ from django.contrib import admin admin.autodiscover() -from sage_days.sdi.views import register +from sage_days.sdi.views import register, homepage from sage_days.settings import APACHE_URL_PREFIX as aup urlpatterns = patterns('', @@ -17,6 +17,6 @@ # Uncomment the next line to enable the admin: (r'^administration/', include(admin.site.urls)), - + (r'^$',homepage), (r'^registration/', include('sage_days.sdi.site.urls')), )