contact form

This commit is contained in:
Sanj 2011-10-13 15:44:25 +05:30
parent c109c02d58
commit 4f23c724be

View File

@ -4,6 +4,20 @@ from models import *
from settings import TWITTER_ID
import twitter
from django.template import RequestContext
from django import forms
from django.forms.widgets import Textarea
class ContactForm(forms.Form):
email = forms.EmailField()
name = forms.CharField(max_length=255)
message = forms.CharField(widget=Textarea(attrs={'cols': 80, 'rows': 20}))
'''
class Meta:
widgets = {
'message': Textarea(attrs={'cols': 80, 'rows': 20})
}
'''
def index(request):
try:
@ -18,5 +32,8 @@ def index(request):
}))
def contact(request):
return render_to_response("registration/contact.html", RequestContext(request, {}))
# form = ContactForm()
return render_to_response("registration/contact.html", RequestContext(request, {
'form': ContactForm()
}))