Fixed settings due to reorganization.
--- a/conference/forms.py Fri Sep 25 00:27:42 2009 +0530
+++ b/conference/forms.py Fri Sep 25 00:55:37 2009 +0530
@@ -2,7 +2,7 @@
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
-from content.models import Participant
+from conference.models import Participant
class ParticipantForm(forms.ModelForm):
--- a/conference/views.py Fri Sep 25 00:27:42 2009 +0530
+++ b/conference/views.py Fri Sep 25 00:55:37 2009 +0530
@@ -13,8 +13,8 @@
from django.template import loader
from django.utils.translation import gettext_lazy as _
-from content.forms import ParticipantForm
-from content.models import Participant
+from conference.forms import ParticipantForm
+from conference.models import Participant
def makemsg(username,url):
--- a/content/forms.py Fri Sep 25 00:27:42 2009 +0530
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-from django import forms
-from django.utils.translation import ugettext_lazy as _
-from content.models import Participant
-from django.contrib.auth.models import User
-
-class Participantform(forms.ModelForm):
- class Meta:
- model = Participant
-
-class Registerform(forms.Form):
- """
- Temporary Registration Form.
- """
- PARTICIPANT_CATEGORY = (
- ('Student','Student'),
- ('Corporate Staff','Corporate Staff'),
- ('Teacher','Teacher'),
- ('Others','Others'),
- )
- username = forms.CharField(max_length=30,
- label="User Name")
- email = forms.EmailField(max_length=75,
- label=u'Email address')
- pass1 = forms.CharField(max_length=50,widget=forms.PasswordInput,
- label=_("Enter New Password"),
- )
- pass2 = forms.CharField(max_length=50,widget=forms.PasswordInput,
- label=_("Enter New Password Again"),
- )
- category = forms.ChoiceField(label=_("Category"),
- choices=PARTICIPANT_CATEGORY)
- organiztion = forms.CharField(max_length=200,
- label=_("Organisation"),
- required=False)
- attending_conf = forms.BooleanField(label=_("Will you attend conference?"))
- attending_tut = forms.BooleanField(label=_("Will you attend tutorial session?"),
- required=False)
- attending_sprint = forms.BooleanField(label=_("Will you attend sprint?"),
- required=False)
-
- def save(self):
- '''To create a user and save additional information
- related to user.
- '''
- profile=self.cleaned_data
- new_user = User.objects.create_user(username=profile.get('username'),
- password=profile.get('pass1'),
- email=profile.get('email'))
- participant = Participantform()
- participant.username = profile.get('username')
- participant.category = profile.get('category')
- participant.organiztion = profile.get('organization')
- participant.attending_conf = profile.get('attending_conf')
- participant.attending_tut = profile.get('attending_tut')
- participant.attending_sprint = profile.get('attending_sprint')
- participant.save()
- return new_user
-
-class LoginForm(forms.Form):
- username = forms.CharField(max_length=30, label=_(u'username'))
- password = forms.CharField(max_length=50,widget=forms.PasswordInput,
- label=_("Enter New Password")
- )
--- a/content/models.py Fri Sep 25 00:27:42 2009 +0530
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-from django.db import models
-from django.forms import ModelForm
-from django.contrib.auth.models import User, UserManager
-
-from django.utils.translation import ugettext_lazy as _
-
-from datetime import datetime
-
-# Create your models here.
-
-class Participant(models.Model):
- '''model for holding details of participants
- '''
- PARTICIPANT_CATEGORY = (
- ('Student','Student'),
- ('Corporate Staff','Corporate Staff'),
- ('Teacher','Teacher'),
- ('Others','Others'),
- )
- username = models.ForeignKey(User, unique=True, related_name='profile')
- category = models.CharField(max_length = 80, choices=PARTICIPANT_CATEGORY,)
- organisation = models.CharField(_("Organisation"),max_length=200,blank = True,null = True)
- attending_conf = models.BooleanField(verbose_name="Will you attend conference?")
- attending_tut = models.BooleanField(verbose_name="Will you attend tutorial session?")
- attending_sprint = models.BooleanField(verbose_name="Will you attend sprint?")
- paper_submission = models.BooleanField(verbose_name="Do you want to Submit paper?")
-
-class ParticipantForm(ModelForm):
- class Meta:
- model = Participant
- #model = User
- #fields = ['username','email','password']
-
-
-class Tempreg(models.Model):
- username = models.CharField(_("User Name"),max_length=30,unique=True)
- email = models.EmailField(_("Email Address"),unique=True)
-
-
--- a/content/views.py Fri Sep 25 00:27:42 2009 +0530
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +0,0 @@
-# Create your views here.
-from django.shortcuts import render_to_response
-from django.template import Context, RequestContext, loader
-from django.contrib.auth.models import User
-from django.http import HttpResponse, HttpResponseRedirect
-from django.contrib.auth import authenticate, login
-from django.utils.translation import gettext_lazy as _
-import time, datetime
-
-from models import *
-from content.forms import *
-import re
-
-def makemsg(username,url):
- """
- Email body to be sent to user.
- """
- msg = _("\
-Dear %(username)s,\n\n\
-\
-Thank you for registering with us. Please visit this url:\n\n\
-%(url)s\n\n\
-to complete the registration\n\n\
-regards\n\
-PyCon India 2009 Team\
-") %{'username': username,'url': url}
- return msg
-
-def home_page(request, template_name='index.html'):
- return render_to_response(template_name)
-
-def logout(request):
- print request.user.username
- if request.user.is_authenticated():
- print request.user.username
- logout(request)
- return HttpResponseRedirect('/')
-
-def register(request):
- """
- Register function.
- """
- if request.user.is_authenticated():
- msg = _("You are already registered")
- return HttpResponseRedirect("/2009/message/%s/" % msg)
- if request.POST:
- # On POST method.
- form = Registerform(request.POST)
- if form.is_valid():
- # If form is clean and has no errors.
- fm = form.cleaned_data
- if len(fm['username']) > 30 or len(fm['username']) < 4:
- # Username should be > 4 characters and less that 30 characters.
- form.errors['username']=[_("User Name must be 4-30 characters long")]
- else:
- r = re.compile(r"[A-Za-z0-9_]")
- for alph in fm['username']:
- # Check if every character of the username is either an
- # alphabet or numeral.
- if not r.match(alph):
- form.errors['username']=[_("Invalid character %s in Username") %(alph)]
- if not form.errors:
- test = User.objects.filter(username__iexact=fm['username'])
- # Check if username already exists.
- if test:
- form.errors['username'] = [("Username registered, try something else")]
- # Check if the email id has already been in use.
- teste = User.objects.filter(email__iexact=fm['email'])
- if teste:
- form.errors['email'] = [_("Email registered. Try something else")]
- else:
- # If username is found in the temporary registration database
- # then show pending error message.
- teste1 = User.objects.filter(email__iexact=fm['email'])
- if teste1:
- form.errors['email'] = [("Username pending registration. Try tomorrow")]
- if not form.errors:
- # If all goes well then push into database.
- new_reg = form.save()
- #new_reg.save()
- return HttpResponseRedirect("/regthank/%i/" % new_reg.id)
- else:
- # On the GET method.
- form = Registerform()
- return render_to_response("register.html",
- {"form":form.as_table(),
- }, context_instance=RequestContext(request))
-
-def regthank(request,id):
- """
- Function displayed after registration is successful.
- """
- p = Participant.objects.get(pk=id)
- t = loader.get_template("regthank.html")
- c = RequestContext(request,
- {"p":p,
- })
- return HttpResponse(t.render(c))
--- a/default.css Fri Sep 25 00:27:42 2009 +0530
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,360 +0,0 @@
-/*
-Design by Free CSS Templates
-http://www.freecsstemplates.org
-Released for free under a Creative Commons Attribution 2.5 License
-*/
-
-body {
- margin: 0;
- padding: 0;
- background: #FFFFFF url(images/img01.jpg) repeat-x;
- text-align: justify;
- font: 15px Arial, Helvetica, sans-serif;
- color: #626262;
-}
-
-form {
- margin: 0;
- padding: 0;
-}
-
-input {
- padding: 5px;
- background: #FEFEFE url(images/img13.gif) repeat-x;
- border: 1px solid #626262;
- font: normal 1em Arial, Helvetica, sans-serif;
-}
-
-h1, h1 a, h2, h2 a, h3, h3 a {
- margin: 0;
- text-decoration: none;
- font-family: Tahoma, Georgia, "Times New Roman", Times, serif;
- font-weight: normal;
- color: #444444;
-}
-
-h1 {
- letter-spacing: -1px;
- font-size: 2.2em;
- font-family: Verdana, Arial, Helvetica, sans-serif;
-}
-
-h2 {
- letter-spacing: -1px;
- font-size: 2em;
-}
-
-h3 {
- font-size: 1em;
-}
-
-p, ol, ul {
- margin-bottom: 2em;
- line-height: 200%;
-}
-
-blockquote {
- margin: 0 0 0 1.5em;
- padding-left: 1em;
- border-left: 5px solid #DDDDDD;
-}
-
-a {
- color: #1692B8;
-}
-
-a:hover {
- text-decoration: none;
-}
-
-/* Header */
-
-#header {
- height: 42px;
-}
-
-#logo h1, #logo p {
- float: left;
-}
-
-#logo h1 {
- padding: 0px 0 0 40px;
-}
-
-#logo p {
- margin: 0;
- padding: 14px 0 0 4px;
- line-height: normal;
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-size: 14px;
-}
-
-#logo a {
- text-decoration: none;
- color: #D0C7A6;
-}
-
-#menu {
- float: right;
-}
-
-#menu ul {
- margin: 0;
- padding: 0;
- list-style: none;
-}
-
-#menu li {
- display: block;
- float: left;
- height: 42px;
-}
-
-#menu a {
- display: block;
- padding: 8px 20px 0px 20px;
- text-decoration: none;
- text-align: center;
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-weight: normal;
- font-size: 14px;
- color: #CEC5A4;
-}
-
-#menu .last {
- margin-right: 20px;
-}
-
-#menu a:hover {
- color: #FFFFFF;
-}
-
-#menu .current_page_item {
-}
-
-#menu .current_page_item a {
-}
-
-/* Page */
-
-#page {
- padding: 40px 40px 0 40px;
-}
-
-/* Content */
-
-#content {
- margin-right: 340px;
-}
-
-.post {
- margin-bottom: 10px;
-}
-
-.post .title {
- border-bottom: 1px #999999 dashed;
- font-family: Tahoma, Georgia, "Times New Roman", Times, serif;
-}
-
-.post .title h2 {
- padding: 30px 30px 0 0px;
- font-weight: normal;
- font-size: 2.2em;
-}
-
-.post .title p {
- margin: 0;
- padding: 0 0 10px 0px;
- line-height: normal;
- color: #BABABA;
-}
-
-.post .title p a {
- color: #BABABA;
-}
-
-.post .entry {
- padding: 20px 0px 20px 0px;
-}
-
-.post .links {
- margin: 0;
- padding: 0 30px 30px 0px;
-}
-
-.post .links a {
- display: block;
- float: left;
- margin-right: 10px;
- margin-bottom: 5px;
- text-align: center;
- text-decoration: none;
- font-weight: bold;
- color: #FFFFFF;
-}
-
-.post .links a:hover {
-}
-
-.post .links .more {
- width: 128px;
- height: 30px;
- background: url(images/img03.jpg) no-repeat left center;
-}
-
-.post .links .comments {
- width: 152px;
- height: 30px;
- background: url(images/img04.jpg) no-repeat left center;
-}
-
-/* Sidebar */
-
-#sidebar {
- float: right;
- width: 300px;
- margin-top: 30px;
-}
-
-#sidebar ul {
- margin: 0;
- padding: 0;
- list-style: none;
-}
-
-#sidebar li {
- margin-bottom: 10px;
- background: url(images/img10.gif) no-repeat left bottom;
-}
-
-#sidebar li ul {
- padding: 0 30px 40px 30px;
-}
-
-#sidebar li li {
- margin: 0;
- padding-left: 20px;
- background: url(images/img11.gif) no-repeat 5px 50%;
-}
-
-#sidebar h2 {
- padding: 30px 30px 20px 30px;
- background: url(images/img09.gif) no-repeat;
- font-weight: normal;
- font-size: 1.6em;
- color: #302D26;
-}
-
-
-/* Search */
-
-#search {
- padding: 20px 30px 40px 30px;
-}
-
-#search input {
- padding: 0;
- width: 70px;
- height: 29px;
- background: #DFDFDF url(images/img14.gif) repeat-x;
- font-weight: bold;
-}
-
-#search #s {
- padding: 5px;
- width: 150px;
- height: auto;
- background: #FEFEFE url(images/img13.gif) repeat-x;
- border: 1px solid #626262;
- font: normal 1em Arial, Helvetica, sans-serif;
-}
-
-#search br {
- display: none;
-}
-
-/* Categories */
-
-#sidebar #categories li {
- background: url(images/img12.gif) no-repeat left center;
-}
-
-/* Calendar */
-
-#calendar_wrap {
- padding: 0 30px 40px 30px;
-}
-
-#calendar table {
- width: 100%;
- text-align: center;
-}
-
-#calendar thead {
- background: #F1F1F1;
-}
-
-#calendar tbody td {
- border: 1px solid #F1F1F1;
-}
-
-#calendar #prev {
- text-align: left;
-}
-
-#calendar #next {
- text-align: right;
-}
-
-#calendar tfoot a {
- text-decoration: none;
- font-weight: bold;
-}
-
-#calendar #today {
- background: #FFF3A7;
- border: 1px solid #EB1400;
- font-weight: bold;
- color: #EB1400
-}
-
-/* Footer */
-
-#footer {
- padding: 70px 0 50px 0;
- background: #757575 url(images/img08.gif) repeat-x;
-}
-
-#footer p {
- margin-bottom: 1em;
- text-align: center;
- line-height: normal;
- font-size: .9em;
- color: #BABABA;
-}
-
-#footer a {
- padding: 0 20px;
- text-decoration: none;
- color: #DDDDDD;
-}
-
-#footer a:hover {
- color: #FFFFFF;
-}
-
-#footer .rss {
- background: url(images/img18.gif) no-repeat left center;
-}
-
-#footer .xhtml {
- background: url(images/img19.gif) no-repeat left center;
-}
-
-#footer .css {
- background: url(images/img20.gif) no-repeat left center;
-}
-
-#footer .legal a {
- padding: 0;
-}
--- a/index.html Fri Sep 25 00:27:42 2009 +0530
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<!--
-
-Design by Free CSS Templates
-http://www.freecsstemplates.org
-Released for free under a Creative Commons Attribution 2.5 License
-
-Title : Concrete
-Version : 1.0
-Released : 20080825
-Description: A Web 2.0 design with fluid width suitable for blogs and small websites.
-
--->
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="content-type" content="text/html; charset=utf-8" />
-<title>SciPy.in</title>
-<meta name="keywords" content="" />
-<meta name="description" content="" />
-<link href="default.css" rel="stylesheet" type="text/css" media="screen" />
-</head>
-<body>
-<!-- start header -->
-<div id="header">
- <div id="logo">
- <h1><a href="#">SciPy.in</a></h1>
- <p><a href="http://fossee.in">Coming soon</a></p>
- </div>
- <div id="menu">
- <ul>
- <li class="current_page_item"><a href="#">Home</a></li>
- <li><a href="#">Blog</a></li>
- <li><a href="#">Photos</a></li>
- <li><a href="#">About</a></li>
- <li class="last"><a href="#">Contact</a></li>
- </ul>
- </div>
-</div>
-<!-- end header -->
-<!-- start page -->
-<div id="page">
- <!-- start sidebar -->
- <div id="sidebar">
- <ul>
- <li id="search" style="background: none;">
- <form id="searchform" method="get" action="">
- <div>
- <input type="text" name="s" id="s" size="15" />
- <br />
- <input type="submit" value="Search" />
- </div>
- </form>
- </li>
- <li id="categories">
- <h2>Categories</h2>
- <ul>
-
- </ul>
- </li>
- </ul>
- </div>
- <!-- end sidebar -->
- <!-- start content -->
- <div id="content">
- <div class="post">
- <div class="title">
- <h2><a href="#">About this Conference</a></h2>
- <p><small>Posted on September 16th, 2009 by <a href="http://fossee.in">FOSSEE group</a></small></p>
- <div class="entry">
- <p>Coming Soon...</p>
- </div>
- <!--<p class="links"> <a href="#" class="more">Read More</a> <a href="#" class="comments">No Comments</a> </p> -->
- </div>
- </div>
- <!-- end content -->
- <br style="clear: both;" />
-</div>
-<!-- end page -->
-<!-- start footer -->
-<div id="footer">
- <p class="links">
- <a href="http://validator.w3.org/check/referer" class="xhtml" title="This page validates as XHTML">Valid <abbr title="eXtensible HyperText Markup Language">XHTML</abbr></a>
-
- <a href="http://jigsaw.w3.org/css-validator/check/referer" class="css" title="This page validates as CSS">Valid <abbr title="Cascading Style Sheets">CSS</abbr></a>
- </p>
- <p class="legal">
- ©2007 Concrete. All Rights Reserved.
- •
- Design by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>
- •
- Icons by <a href="http://famfamfam.com/">FAMFAMFAM</a>. </p>
-</div>
-<!-- end footer -->
-</body>
-</html>
Binary file participants has changed
--- a/settings.py Fri Sep 25 00:27:42 2009 +0530
+++ b/settings.py Fri Sep 25 00:55:37 2009 +0530
@@ -12,9 +12,9 @@
MANAGERS = ADMINS
-DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
-DATABASE_NAME = '../conference' # Or path to database file if using sqlite3.
-DATABASE_USER = '' # Not used with sqlite3.
+DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
+DATABASE_NAME = 'conference' # Or path to database file if using sqlite3.
+DATABASE_USER = 'root' # Not used with sqlite3.
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.
--- a/template/register.html Fri Sep 25 00:27:42 2009 +0530
+++ b/template/register.html Fri Sep 25 00:55:37 2009 +0530
@@ -1,5 +1,7 @@
{% extends "index.html" %}
+
{% load i18n %}
+
{% block centercontent %}
<div class="post">
<div class="title"><h2>{% trans "Register" %}</h2></div>