BN.com Gift Guide

Python Web Development with Django [NOOK Book]

Overview

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 ...

See more details below
Python Web Development with Django

Available on NOOK devices and apps  
  • NOOK Devices
  • Samsung Galaxy Tab 4 NOOK 7.0
  • Samsung Galaxy Tab 4 NOOK 10.1
  • NOOK HD Tablet
  • NOOK HD+ Tablet
  • NOOK eReaders
  • NOOK Color
  • NOOK Tablet
  • Tablet/Phone
  • NOOK for Windows 8 Tablet
  • NOOK for iOS
  • NOOK for Android
  • NOOK Kids for iPad
  • PC/Mac
  • NOOK for Windows 8
  • NOOK for PC
  • NOOK for Mac

Want a NOOK? Explore Now

NOOK Book (eBook)
$22.99
BN.com price
(Save 42%)$39.99 List Price

Overview

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

Read More Show Less

Product Details

  • ISBN-13: 9780132701815
  • Publisher: Pearson Education
  • Publication date: 11/7/2008
  • Sold by: Barnes & Noble
  • Format: eBook
  • Edition number: 1
  • Pages: 408
  • Sales rank: 728,437
  • File size: 12 MB
  • Note: This product may take a few minutes to download.

Meet 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 bestseller, Core Python Programming (corepython.com), its video training course, Python Fundamentals (LiveLessons DVD), and coauthor of Python Web Development with Django (withdjango.com). In addition to being a senior software architect, he runs CyberWeb (cyberwebconsulting.com), a consulting business specializing in Python software engineering and technical training. He has more than 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.

Read More Show Less

Read an Excerpt

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 comprehensivechapter, 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.

Read More Show Less

Table of Contents

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

Read More Show Less

Customer Reviews

Average Rating 4
( 3 )
Rating Distribution

5 Star

(1)

4 Star

(1)

3 Star

(1)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing all of 3 Customer Reviews
  • Anonymous

    Posted January 6, 2009

    No text was provided for this review.

  • Anonymous

    Posted September 7, 2010

    No text was provided for this review.

  • Anonymous

    Posted February 14, 2009

    No text was provided for this review.

Sort by: Showing all of 3 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)