changed the app to work with apache + added base.html, and did needed changes.
--- 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
+*.*~
--- 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),
)
--- 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")
+
--- 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"
--- 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 @@
-<html>
-<body>
+{% extends 'base.html' %}
+{% block content %}
<form action="" method="post">
<!--
Topics: <input name="topics" value=""{{topics}}> <br />
@@ -37,6 +37,4 @@
</tr>
{% endfor %}
</table>
-
-</body>
-</html>
+{% endblock %}
--- a/templates/reg_complete.html Sat May 29 19:35:49 2010 +0530
+++ b/templates/reg_complete.html Thu Jun 03 19:06:14 2010 +0530
@@ -1,8 +1,8 @@
-<html>
-<body>
+{% extends 'base.html' %}
+{% block content %}
<script language="javascript">
-setTimeout("document.location='/'", 10000);
+setTimeout("document.location='/sage_days'", 10000);
</script>
You have successfully registered for Sage Days India 25. <br />
You will be automatically redirected to sage days website in a few seconds.
-</body>
+{% endblock %}
--- a/templates/register.html Sat May 29 19:35:49 2010 +0530
+++ b/templates/register.html Thu Jun 03 19:06:14 2010 +0530
@@ -1,5 +1,5 @@
-<html>
-<body>
+{% extends 'base.html' %}
+{% block content %}
<form action="" method="post">
{{form.as_p}}
<!--
@@ -10,4 +10,4 @@
-->
<input type="submit" value="Register" />
</form>
-</body>
+{% endblock %}
--- 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')),
)