Python Web Development with Django and over one million other books are available for Amazon Kindle. Learn more



or
Sign in to turn on 1-Click ordering
Sell Us Your Item
For a $2.50 Gift Card
Trade in
More Buying Choices
Have one to sell? Sell yours here
Start reading Python Web Development with Django on your Kindle in under a minute.

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.
Sorry, this item is not available in
Image not available for
Color:
Image not available

To view this video download Flash Player

 

Python Web Development with Django [Paperback]

Jeff Forcier , Paul Bissex , Wesley Chun
3.5 out of 5 stars  See all reviews (19 customer reviews)

Buy New
$28.32 & FREE Shipping. Details
Rent
$23.88
Only 1 left in stock (more on the way).
Ships from and sold by Amazon.com. Gift-wrap available.
In Stock.
Rented by RentU and Fulfilled by Amazon.
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Free Two-Day Shipping for College Students with Amazon Student

Formats

Amazon Price New from Used from
Kindle Edition $26.90  
Paperback $28.32  
Rent Your Textbooks
Save up to 70% when you rent your textbooks on Amazon. Keep your textbook rentals for a semester and rental return shipping is free.

Book Description

November 3, 2008 0132356139 978-0132356138 1
Using the simple, robust, Python-based Django framework, you can build powerful Web solutions with remarkably few lines of code. In Python Web Development with Django®, three experienced Django and Python developers cover all the techniques, tools, and concepts you need to make the most of Django 1.0, including all the major features of the new release.

 

The authors teach Django through in-depth explanations, plus provide extensive sample code supported with images and line-by-line explanations. You’ll discover how Django leverages Python’s development speed and flexibility to help you solve a wide spectrum of Web development problems and learn Django best practices covered nowhere else. You’ll build your first Django application in just minutes and deepen your real-world skills through start-to-finish application projects including

  • Simple Web log (blog)
  • Online photo gallery
  • Simple content management system
  • Ajax-powered live blogger
  • Online source code sharing/syntax highlighting tool
  • How to run your Django applications on the Google App Engine

 

This complete guide starts by introducing Python, Django, and Web development concepts, then dives into the Django framework, providing a deep understanding of its major components (models, views, templates), and how they come together to form complete Web applications. After a discussion of four independent working Django applications, coverage turns to advanced topics, such as caching, extending the template system, syndication, admin customization, and testing. Valuable reference appendices cover using the command-line, installing and configuring Django, development tools, exploring existing Django applications, the Google App Engine, and how to get more involved with the Django community.

 

 

Introduction 1

 

Part I: Getting Started

Chapter 1: Practical Python for Django 7

Chapter 2: Django for the Impatient: Building a Blog 57

Chapter 3: Starting Out 77

 

Part II: Django in Depth

Chapter 4: Defining and Using Models 89

Chapter 5: URLs, HTTP Mechanisms, and Views 117

Chapter 6: Templates and Form Processing 135

 

Part III: Django Applications by Example

Chapter 7: Photo Gallery 159

Chapter 8: Content Management System 181

Chapter 9: Liveblog 205

Chapter 10: Pastebin 221

 

Part IV: Advanced Django Techniques and Features

Chapter 11: Advanced Django Programming 235

Chapter 12: Advanced Django Deployment 261

 

Part V: Appendices

Appendix A: Command Line Basics 285

Appendix B: Installing and Running Django 295

Appendix C: Tools for Practical Django Development 313

Appendix D: Finding, Evaluating, and Using Django Applications 321

Appendix E: Django on the Google App Engine 325

Appendix F: Getting Involved in the Django Project 337

 

Index 339

Colophon 375


Frequently Bought Together

Python Web Development with Django + The Definitive Guide to Django: Web Development Done Right + Python Essential Reference (4th Edition)
Price for all three: $89.46

Some of these items ship sooner than the others.

Buy the selected items together


Editorial Reviews

About the Author

Jeffrey E. Forcier currently works as a systems administrator and backend Web developer at Digital Pulp, Inc., a New York-based interactive agency and Web development company. He has 7 years experience in Web development with PHP and Python, including professional and personal use of the Django framework since its public release in 2005. He holds a degree in Computer Science from the University of Massachusetts.
 
Paul Bissex has worked as a graphic designer, writer, teacher, babysitter, and software developer. He was an early adopter of Django and is the creator and maintainer of dpaste.com, the Django community pastebin site. From September to June, he can be found at the Hallmark Institute of Photography (hallmark.edu), teaching Web development and using Python and Django to build everything from attendance systems to housing databases to image processing utilities. His writings on technology have appeared in Wired, Salon.com, and the Chicago Tribune. Since 1996, he has served as a conference host for The Well (well.com), which Wired magazine called "the world's most influential online community," and currently hosts the Web conference there. He lives in Northampton, Massachusetts, with his wife Kathleen.
 
Wesley J. Chun is author of Prentice Hall's bestselling "Core Python" series (corepython.com), the Python Fundamentals companion video lectures, co-author of Python Web Development with Django (withdjango.com), and has written for Linux Journal, CNET, and InformIT. In addition to being an architect and Developer Advocate at Google, he runs CyberWeb (cyberwebconsulting.com), a consultancy specializing in Python training. He has over 25 years of programming, teaching, and writing experience, including more than a decade of Python. While at Yahoo!, he helped create Yahoo! Mail and Yahoo! People Search using Python. He holds degrees in Computer Science, Mathematics, and Music from the University of California.

Excerpt. © Reprinted by permission. All rights reserved.

Preface

Preface

Welcome to Django!

Greetings, and welcome to Django! We're glad to have you along on our journey. You will discover a powerful tool that lets you do everything rapidly—from designing and developing the original app and being able to make simple and quick changes that have a profound effect on its features and functionality without having to make major changes to the codebase.

About This Book

There are already several Django books on the market, but ours differs from most in that we focus equally on three areas: Django basics, a variety of example applications, and advanced Django topics. Our intent is to make this the most well-rounded book on the subject, one you find useful regardless of background, and which will give you a complete picture of the framework and what you can do with it.

Chapter Guide

In Figure 0.1, you see recommended starting points for your reading depending on your Python and Django experience. Of course, we recommend a cover-to-cover treatment, but the diagram serves to help if time is not on your side. Regardless of your experience, you are always welcome to look at the applications because reading and studying code is one of the best ways to learn. Below the figure, we provide a chapter-by-chapter reading guide to further help direct you to where you need to read.

Figure 0.1

Part I, "Getting Started," covers the basic material needed to introduce users new to Django and/or Python, although we recommend Chapter 3, "Starting Out," even to advanced readers.

Chapter 1, "Practical Python for Django," is meant to introduce our readers who are new to Python. In one comprehensive chapter, we show you not only the syntax, but also go a bit more in-depth and expose you to Python's memory model and data types, especially constructs which are commonly used in Django.

Chapter 2, "Django for the Impatient: Building a Blog," is a "getting started" chapter for those who want to skip any Python introduction and want to dive immediately into a Django application that can be completed in 15-20 minutes. It gives a good overview of what's possible with the framework.

For those with a bit more patience, Chapter 3, "Starting Out," serves as an introduction to all of the foundations of developing Web-based applications (useful both for newbies and experienced coders alike). Once the formalities are over, we describe how each concept fits into the world of Django as well as what its philosophies are and how it may differ from other Web application frameworks.

Part II, "Django in Depth," covers all the basic components of the framework, laying the foundation for the example applications in Part III, " Django Applications by Example."

In Chapter 4, "Defining and Using Models," learn how to define and work with your data model, including the basics of Django's object-relational mapper (ORM) from simple fields up to complex relations.

Chapter 5, "URLs, HTTP Mechanisms, and Views," goes into detail on how Django handles URL processing and the rest of the HTTP protocol, including middleware layers, as well as how to use Django's time-saving generic views, and how to write custom or partially custom views from scratch.

Chapter 6, "Templates and Form Processing," is the final major piece of the framework, where we explore Django's template language and its form-handling mechanisms. It covers how to display data to your users and get data back from them.

In Part III, "Django Applications by Example," we create four distinct applications, each highlighting a different aspect or component of Django development, both to introduce new general ideas and to expand upon the concepts found in Parts I and II.

In Chapter 7, "Photo Gallery," learn how to apply the "Don't Repeat Yourself" convention to your URL structure and create a new thumbnail-creating image form field, while you make a simple photo gallery application.

Chapter 8, "Content Management System," contains two related approaches to creating a CMS or CMS-like system and covers the use of a number of "contrib" Django applications.

Chapter 9, "Liveblog," covers writing a "liveblog"—a site that makes use of advanced JavaScript techniques—serves as a backdrop for applying AJAX to a Django project and shows how easy it is to use any AJAX toolkit you want.

In Chapter 10, "Pastebin," learn the power of Django's generic views as we create a pastebin using almost no custom logic whatsoever.

Part IV, "Advanced Django Techniques and Features," is a collection of advanced topics, ranging from customizing Django's admin application to writing command-line scripts which interface with your Django applications.

Chapter 11, "Advanced Django Programming," covers a number of topics related to fleshing out your own application's code, such as RSS generation, extending the template language, or making better use of the Django admin application.

In Chapter 12, "Advanced Django Deployment," learn a number of tricks related to deploying Django applications or working with your app from outside your Django project's core code, such as command-line scripts, cron jobs, testing, or data import.

Part V, "Appendices," fills in the remaining gaps or addresses topics relevant to the rest of the book but which don't fit in well as full chapters. Learn the basics of the Unix command line, Django installation and deployment strategies, tools for development, and more.

Appendix A, "Command Line Basics," is an introduction to the Unix command line for those who haven't been exposed to it before now. Trust us—it's useful!

In Appendix B, "Installing and Running Django," learn how to install all the necessary components for running Django, including the various options for database and Web servers, as well as some tips on specific deployment strategies.

Appendix C, "Tools for Practical Django Development," outlines some basic development tools you may or may not be familiar with, including source control, text editors, and more.

Good developers write code, but great developers reuse somebody else's code! In Appendix D, "Finding, Evaluating, and Using Django Applications," we share some tips on the where and how of finding reusable Django applications.

Appendix E, "Django on the Google App Engine ," provides an exclusive look at how Google's new App Engine leverages Django, and you can also learn how to enable your Django applications to run under the App Engine framework.

In Appendix F, "Getting Involved in the Django Project," learn how to contribute to Django and become a part of the community.

Conventions

Throughout this book, we use bold to introduce new or important terms, italics for emphasis, <http://links/> for URLs, and monospacing to delineate Python and command line material such as variable names or commands. Multiline blocks of code or command examples are in monospaced blocks, like so:

    >>> print "This is Python!"     This is Python!

We have made use of all three major platforms—Mac OS X, Linux, and Windows—when writing this book and the example applications. In addition, we've used all major browsers (although not all may be present in our screenshots), namely Firefox, Safari, Opera, and Internet Explorer.

Book Resources

You can contact the authors collectively at authors@withdjango.com. Our Web site, http://withdjango.com, contains a large amount of auxiliary material and is referenced in a number of places throughout the book.


© Copyright Pearson Education. All rights reserved.


Product Details

  • Paperback: 408 pages
  • Publisher: Addison-Wesley Professional; 1 edition (November 3, 2008)
  • Language: English
  • ISBN-10: 0132356139
  • ISBN-13: 978-0132356138
  • Product Dimensions: 7 x 0.8 x 9.1 inches
  • Shipping Weight: 1.2 pounds (View shipping rates and policies)
  • Average Customer Review: 3.5 out of 5 stars  See all reviews (19 customer reviews)
  • Amazon Best Sellers Rank: #41,322 in Books (See Top 100 in Books)

More About the Authors

Discover books, learn about writers, read author blogs, and more.

Customer Reviews

The chapter seems decent enough, although I haven't had to do any of these things yet. Kelly P. Vincent  |  2 reviewers made a similar statement
I've read four books on Django now, as well as the documentation on the Django website. C. Young  |  2 reviewers made a similar statement
I highly recommend it for those like myself who are fairly new to Python and Django. ldm616  |  4 reviewers made a similar statement
Most Helpful Customer Reviews
30 of 32 people found the following review helpful
3.0 out of 5 stars A reasonable introduction to Django December 22, 2008
Format:Paperback
We are a Python shop at work and have recently started developing in Django. So I picked this book up as a total beginner to Django, but an experienced Python programmer. I feel that the book would be more or less the same even for someone totally new to Python, because Django is definitely a different kind of beast.

Overall, this book was okay to good. I would give it 3.5 stars if I could. It is definitely targeted at beginners to Django (and possibly Python). As a Django beginner, I first ran through the tutorial on the Django website, because it is very thorough and good. I definitely recommend that as a starting place regardless of which book you end up buying. Then I cracked open this book. The first chapter is a 50-page introduction to Python, so I skipped that. Chapter 2 is a tutorial in which you build a simple blog. So by the time I had finished that chapter, I had built two different Django sites but not really read anything about the language or framework or theory thereof. I think this is a good thing, and this chapter is well-placed. Chapter 3 introduces Django. It covers dynamic web sites, communication, data storage, presentation, separating the layers (MVC), general django architecture, and "core philosophies of Django". It is a decent introduction, though I read through it quickly so I could get to the next three chapters.

The next three chapters make up the Django in Depth section and are the bread-and-butter of the book. The first chapter covers models, the second URLs/HTTP/views, and the third templates and form processing. For me, these were the chapters I was most looking forward to, where I would learn everything I needed to know to get started really understanding. And they let me down a bit. Each one was good in what it covered, but the problem was that it left out quite a bit. The part on the models themselves was pretty good and covered the necessities. But the part on querying was a little sparse. They left much for the reader to go to the documentation and find out. (But what's the point of the book, then?) I did think it was nice that they mentioned fixtures, as I had trouble finding that information online when I needed to set one up for work. The chapter on views was decent, but seemed to leave out too much detail. The section covering views specifically was short. Finally, the template/forms chapter again left the reader to find out critical details in the online documentation. First, the template section was short. Second, the forms section seemed long enough, but I just found that it wasn't that helpful when I was really creating forms for work.

The next four chapters are tutorials in which you build various applications. I haven't gone through these yet, but they look pretty good. I think Django is one of those things that is best learned in a very hands-on fashion. Perhaps some of the weaknesses of the previous three chapters are made up for here; but I doubt it, and if so feel that information should have still been included in the earlier chapters. (The book is fairly slim and could definitely be expanded.) Chapter 11 covers advanced Django programming, including customizing the admin, using syndication, generating downloadable files, enhancing Django's ORM with custom managers, and extending the template system. The chapter seems decent enough, although I haven't had to do any of these things yet. Likewise, with Chapter 12 covering advanced Django deployment, I haven't had to deploy anything yet so I only know that the chapter seems to cover some useful information.
Was this review helpful to you?
13 of 15 people found the following review helpful
4.0 out of 5 stars Good Information on Django December 9, 2008
Format:Paperback|Amazon Verified Purchase
I've read four books on Django now, as well as the documentation on the Django website. Some of the information in the other books is now outdated since Django 1.0 was released, but this book does not suffer from that problem.

I liked this book because it was short and to the point, is up-to-date, and clarified some of the documentation on the Django website.

If you only want to buy one book on Django, this would be the best one to get; in my opinion.
Comment | 
Was this review helpful to you?
10 of 11 people found the following review helpful
4.0 out of 5 stars Not an easy beginner book. January 21, 2009
Format:Paperback
Coming from a PHP background, I decided to take on a more serious development language for my future web projects. I picked Python and Django.

This book covers basic Python first. So it's not necessary to learn Python from a dedicated book. The primer in this book is adequate. And the online documentation is great to fill in the spaces as needed.

The thing I like most about the book is that it covers a tremendous amount of ground. The example projects use advanced functions and structures that other books avoid, and the coding structures can be complex and deep. DRY (Don't Repeat Yourself) is a core philosophy in Python and in Django. These authors do a great job keeping the code DRY. And that often means building elegant, but hard to understand code.

The thing I don't like about the book is related to what I think makes it so good. It's damn complex at times.

Often while trying to work through some code examples and reproduce the results, I find that I don't understand the structure of something. I'll end up spending 10 minutes or a few hours consulting the online docs learning the new functions and trying to understand some structure that is outlined in the book.

The book isn't very long for all the content that's packed inside. And that's mostly due to the fact that the authors have left out explanations for a lot of what is going on behind the scenes in their more complex bits of code.

Django is a pretty deeply nested framework (in my limited experience). When you call on an object, it might be a subclass of a subclass of another subclass that inherited from two other classes, one of which is a subclass of another. So, to really understand what an object is like can be complicated. The same goes for functions.

Django is similar in the way an application uses a lot of different files through multiple imports to pull together even the simplest of views.

If you are coming from working with Python or C or Perl or something else where you spend a lot of time on the command line and OOP is second nature to you, this book will probably be easy to work through. If you are just using PHP or ASP, get ready for a major learning curve. And maybe just consider looking at the other Django books instead.

One other benefit to this book over others is that it's relatively new and incorporates some of the bigger changes that were made in version 1.0 of Django. This can save you some time trying to figure out why the code examples don't work if you use the older books with the newer release of Django.
Comment | 
Was this review helpful to you?
Most Recent Customer Reviews
2.0 out of 5 stars What is this??
I am probably not entitled to make a review on this, Django (or Python -anything-), due to the fact that relatively I am very unexperienced but since I have a background history... Read more
Published 4 months ago by B D. Rodriguez
4.0 out of 5 stars Good starting Python-Django mat'l, but it's way out of date ...
Used book to supplement UNIX/Linux 101 undergraduate college course that I taught in Fall'2011 ... I/class ran into multiple issues running book's sample code ... Read more
Published 16 months ago by JCGARU
1.0 out of 5 stars Book leaves a lot out
This book has a lot of information on Django but it assumes that the reader has previous knowledge of the development library. Read more
Published on February 10, 2011 by TK
2.0 out of 5 stars Well written, but misses examples
Coverage in the first three chapters is okay. Even though when they start getting into examples, the authors seem to jump from Windows to Mac quite often. Read more
Published on July 20, 2010 by Sree
1.0 out of 5 stars Kindle Edition Lacks Monospaced Fonts
I probably would give the content of the book 4 stars.

However, the book claims in the preface that "monospacing [is used] to delineate Python and command line material... Read more
Published on June 16, 2010 by J. Ledoux
4.0 out of 5 stars Excellent review of Python and intro to Django
Well written book that explains how Python and Django work together. If you're new to either, this is a good place to start. Read more
Published on January 9, 2010 by David Alan Tussey
3.0 out of 5 stars Could be better.
I found this book pretty ok, although there are some typos, some of the descriptions could be better .... Read more
Published on September 16, 2009 by Obi Wan Prep-Obi
5.0 out of 5 stars Concise and well written django book
I've found this book to be a very good source of information both for programmers with some Django experience as well as for those who are Django beginners. Read more
Published on June 18, 2009 by zeevb
4.0 out of 5 stars A good entry level Django book
I got turned on to Django after reading an OReily book on Google App Engine. I ordered this book, and another to get more of a feeling for Django development. Read more
Published on June 9, 2009 by Nicholas Sardo
4.0 out of 5 stars Good introduction to Django.
This book is quite a good introduction to Python/Django web development, but not necessarily an in-depth one. Read more
Published on May 10, 2009 by Alexander T. Esplin
Search Customer Reviews
Only search this product's reviews

What Other Items Do Customers Buy After Viewing This Item?


Forums

There are no discussions about this product yet.
Be the first to discuss this product with the community.
Start a new discussion
Topic:
First post:
Prompts for sign-in
 



So You'd Like to...


Create a guide


Look for Similar Items by Category