Related Titles
- Full Description
-
This latest edition of The Definitive Guide to Django is updated for Django 1.1, and, with the forwardcompatibility guarantee that Django now provides, should serve as the ultimate tutorial and reference for this popular framework for years to come.
Django, the Pythonbased equivalent to Rubys Rails web development framework, is one of the hottest topics in web development today. Lead developer Jacob KaplanMoss and Django creator Adrian Holovaty show you how they use this framework to create awardwinning web sites by guiding you through the creation of a web application reminiscent of ChicagoCrime.org.
The Definitive Guide to Django is broken into three parts, with the first introducing Django fundamentals such as installation and configuration, and creating the components that together power a Djangodriven web site. The second part delves into the more sophisticated features of Django, including outputting nonHTML content such as RSS feeds and PDFs, caching, and user management. The appendixes serve as a detailed reference to Djangos many configuration options and commands.
What youll learn
- The first half of this book explains in depth how to build web applications using Django including the basics of dynamic web pages, the Django templating system interacting with databases, and web forms.
- The second half of this book discusses higher-level concepts such as caching, security, and how to deploy Django.
- The appendixes form a reference for the commands and configurations available in Django.
Who this book is for
Anyone who wants to use the powerful Django framework to build dynamic web sites quickly and easily.
- Table of Contents
-
Table of Contents
- Introduction to Django
- Getting Started
- Views and URLconfs
- Templates
- Models
- The Django Admin Site
- Forms
- Advanced Views and URLconfs
- Advanced Templates
- Advanced Models
- Generic Views
- Deploying Django
- Generating Non-HTML Content
- Sessions, Users, and Registration
- Caching
- django.contrib
- Middleware
- Integrating with Legacy Databases and Applications
- Internationalization
- Security
- Errata
-
If you think that you've found an error in this book, please let us know about it. You will find any confirmed erratum below, so you can check if your concern has already been addressed.
On page 133:
class ContactForm(forms.Form):
subject = forms.CharField()
e-mail = forms.EmailField(required=False)
message = forms.CharField()
e-mail is wrong, call it email without the hyphen, otherwise, when importing the form module, python complains
framazz@twilight:~/django/prova$ python manage.py shell
Python 2.7.2+ (default, Nov 30 2011, 19:22:03)
[GCC 4.6.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from contact.forms import ContactForm
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/home/framazz/django/prova/contact/forms.py", line 5
e-mail = forms.EmailField(required=False)
SyntaxError: can't assign to operator
On page 168:
both in view_1 and view_2
return t.render(c) should be
return HttpResponse(t.render(c))
also add
from django.http import HttpResponse on top of the views
On page 169:
def custom_proc(request):
"A context processor that provides 'app', 'user' and 'ip_address'."
should be:
def custom_proc(request):
'''A context processor that provides 'app', 'user' and 'ip_address'. '''
With three quote marks







