The Definitive Guide to Django: Web Development Done Right (Expert's Voice in Web Development)

The Definitive Guide to Django: Web Development Done Right (Expert's Voice in Web Development)

Adrian Holovaty, Jacob Kaplan-Moss

Language: English

Pages: 536

ISBN: 143021936X

Format: PDF / Kindle (mobi) / ePub


This latest edition of The Definitive Guide to Django is updated for Django 1.1, and, with the forward–compatibility guarantee that Django now provides, should serve as the ultimate tutorial and reference for this popular framework for years to come.

Django, the Python–based equivalent to Ruby’s Rails web development framework, is one of the hottest topics in web development today. Lead developer Jacob Kaplan–Moss and Django creator Adrian Holovaty show you how they use this framework to create award–winning 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 Django–driven web site. The second part delves into the more sophisticated features of Django, including outputting non–HTML content such as RSS feeds and PDFs, caching, and user management. The appendixes serve as a detailed reference to Django’s many configuration options and commands.

What you’ll 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

  1. Introduction to Django
  2. Getting Started
  3. Views and URLconfs
  4. Templates
  5. Models
  6. The Django Admin Site
  7. Forms
  8. Advanced Views and URLconfs
  9. Advanced Templates
  10. Advanced Models
  11. Generic Views
  12. Deploying Django
  13. Generating Non-HTML Content
  14. Sessions, Users, and Registration
  15. Caching
  16. django.contrib
  17. Middleware
  18. Integrating with Legacy Databases and Applications
  19. Internationalization
  20. Security

Puppet 3 Beginner's Guide

Learn to Code HTML and CSS: Develop and Style Websites (Voices That Matter)

Web Analytics 2.0: The Art of Online Accountability and Science of Customer Centricity

Programming Google App Engine with Java

SQL For Dummies

HTML5 and CSS3 All-in-One For Dummies (3rd Edition)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

starts with “1.” Once Django hits 2.0, though, your applications might need to be rewritten—but version 2.0 is a long way away. As a point of reference, it took more than three years to release version 1.0. (This is very similar to the compatibility policy that applies to the Python language itself: code that was written for Python 2.0 works with Python 2.6, but not necessarily with Python 3.0.) Given that this book covers Django 1.1, it should serve you well for some time. Getting Help One of

Python function that takes an DpplNamqaop as its first parameter and returns an instance of DpplNaolkjoa. In order for a Python function to be a Django view, it must do these two things. (There are exceptions, but we’ll get to them later.) Your First URLconf If at this point you run lupdkji]j]ca*lunqjoanran again, you’ll still see the “Welcome to Django” message, with no trace of the “Hello world” view anywhere. That’s because the iuoepa project doesn’t yet know about the dahhk

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 Philosophies and Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 Using Templates in Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 NC O N T E N T S Template Loading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 render_to_response() . . . . . . . . . . . . . . . . . . . . . . . . . . .

behavior while in Django’s debug mode. To do this, just check the value of the @A>QC setting at runtime, like so: bnki`f]jck*_kjbeilknpoappejco bnki`f]jck*_kjb*qnho*`ab]qhpoeilknp& bnkiiuoepaeilknpreaso qnhl]ppanjo9l]ppanjo$##( $n#Z #(reaso*dkial]ca%( $n#Z$X`w0y%+$W])vYw/y%+ #(reaso*]n_dera[ikjpd%( % eboappejco*@A>QC6 qnhl]ppanjo'9l]ppanjo$##( $n#Z`a^qcejbk+ #(reaso*`a^qc%( % In this example, the URL +`a^qcejbk+ will be available only if your @A>QC setting

bnkiiuoepa*reasoeilknpnamqenao[hkcej(iu[reas-(iu[reas.(iu[reas/ qnhl]ppanjo9l]ppanjo$##( $n#Zreas-+ #(namqenao[hkcej$iu[reas-%%( $n#Zreas.+ #(namqenao[hkcej$iu[reas.%%( $n#Zreas/+ #(namqenao[hkcej$iu[reas/%%( % This has the same effect as before, but with less code redundancy. Now we’ve created a nice generic function—namqenao[hkcej$% that we can wrap around any view in order to make it require a login. Including Other URLconfs If you intend your code to be used on

Download sample

Download