Book Image

Learning Website Development with Django

Book Image

Learning Website Development with Django

Overview of this book

Table of Contents (18 chapters)
Learning Website Development with Django
Credits
About the Author
About the Reviewers
Preface
Index

User Registration


The first user account was added to the database during the creation of our Django project. However, site visitors also need a method to create accounts on the site. User registration is a basic feature found in all social networking sites nowadays. We will create a user registration form in this section, and in the process we will also learn about the Django library that handles form generation and processing.

Django Forms

Creating, validating and processing forms is an all too common task. Web applications receive input and collect data from users by means of web forms. So naturally Django comes with its own library to handle these tasks. In Django 0.96, the library is called newforms but it will be renamed to forms in Django 1.0 (once it has been released). To avoid having to go through a lot of code updates when the name changes, it is recommended to import the package like this:

from django import newforms as forms

This way, when the library name changes in Django 1.0...