Commits

Anonymous committed 136c396

Couple fixes and tweaks, bumping to 0.3

  • Participants
  • Parent commits 886641f
  • Tags v0.3

Comments (0)

Files changed (5)

 The other method is to download a packaged version and use Python's
 ``distutils`` to install it onto your Python path::
 
-    wget http://django-contact-form.googlecode.com/files/contact_form-0.2.tar.gz
-    tar zxvf contact_form-0.2.tar.gz
-    cd contact-form-0.2
+    wget http://django-contact-form.googlecode.com/files/contact_form-0.3.tar.gz
+    tar zxvf contact_form-0.3.tar.gz
+    cd contact-form-0.3
     python setup.py install
 
 Depending on your system configuration, you may need to prefix the

contact_form/forms.py

 
 """
 
+
 import sha
+
 from django import newforms as forms
 from django.conf import settings
 from django.core.mail import send_mail
 from django.template import loader, RequestContext
 from django.contrib.sites.models import Site
 
+
 # I put this on all required fields, because it's easier to pick up
 # on them with CSS or JavaScript if they have a class of "required"
 # in the HTML. Your mileage may vary.

contact_form/urls.py

 
 """
 
+
 from django.conf.urls.defaults import *
 from django.views.generic.simple import direct_to_template
+
 from contact_form.views import contact_form
 
+
 urlpatterns = patterns('',
-                       url(r'^contact/$',
+                       url(r'^$',
                            contact_form,
                            name='contact_form'),
-                       url(r'^contact/sent/$',
+                       url(r'^sent/$',
                            direct_to_template,
                            { 'template': 'contact_form/contact_form_sent.html' },
                            name='contact_form_sent'),

contact_form/views.py

+"""
+View which can render and send email from a contact form.
+
+"""
+
+
 from django.http import HttpResponseRedirect
 from django.shortcuts import render_to_response
 from django.template import RequestContext
 from django.contrib.auth.views import redirect_to_login
+
 from contact_form.forms import ContactForm
 
+
 def contact_form(request, form_class=ContactForm, template_name='contact_form/contact_form.html', success_url='/contact/sent/', login_required=False, fail_silently=False):
     """
     Renders a contact form, validates its input and sends an email
 from distutils.core import setup
 
 setup(name='contact_form',
-      version='0.2',
+      version='0.3',
       description='Generic contact-form application for Django',
       author='James Bennett',
       author_email='james@b-list.org',