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

Account Management


So far we have implemented session management and registration facilities. We now need to let the user update account information, such as the password or email address. To implement such features, we can do one of two things:

  • We can use the views that Django provides for common account management tasks as we did when creating the login form.

  • We can design our own form and process its input data as we did with the registration form.

We've seen how to use both approaches. Each approach has its advantages and disadvantages. Obviously, designing your own form gives you greater control, but it requires more code. On the other hand, using a Django view is faster, but in this case you are limited to the form offered by Django. In the end, it's up to you to decide which approach to use.

I will summarize the views provided by the django.contrib.auth application below. Each view expects a certain template name to be available, and passes some variables to this template. Input handling...