Django 1.0 Website Development

Django 1.0 Website Development
eBook: $23.99
Formats: PDF, PacktLib, ePub and Mobi formats
save 40%!
Print + free eBook + free PacktLib access to the book: $63.98    Print cover: $39.99
save 37%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Table of Contents
Sample Chapters
  • Teaches everything you need to create a complete Web 2.0-style web application with Django 1.0
  • Learn rapid development and clean, pragmatic design
  • No knowledge of Django required
  • Packed with examples and screenshots for better understanding

Book Details

Language : English
Paperback : 272 pages [ 235mm x 191mm ]
Release Date : March 2009
ISBN : 1847196780
ISBN 13 : 9781847196781
Author(s) : Ayman Hourieh
Topics and Technologies : All Books, Web Development, Open Source, Web Development

Table of Contents

Chapter 1: Introduction to Django
Chapter 2: Getting Started
Chapter 3: Building a Social Bookmarking Application
Chapter 4: User Registration and Management
Chapter 5: Introducing Tags
Chapter 6: Enhancing the User Interface with AJAX
Chapter 7: Voting and Commenting
Chapter 8: Creating an Administration Interface
Chapter 9: Advanced Browsing and Searching
Chapter 10: Building User Networks
Chapter 11: Extending and Deploying
Chapter 12: What Next?
  • Chapter 1: Introduction to Django
    • MVC pattern in web development
    • Why Python?
    • Why Django?
      • Tight integration between components
      • Object-Relational Mapper
      • Clean URL design
      • Automatic administration interface
      • Advanced development environment
      • Multilingual support
    • History of Django
    • Summary
  • Chapter 2: Getting Started
    • Installing the required software
      • Installing Python
        • Installing Python on Windows
        • Installing Python on UNIX/Linux
        • Installing Python on Mac OS X
      • Installing Django
        • Installing Django on Windows
        • Installing Django on UNIX/Linux and Mac OS X
      • Installing a database system
    • Creating your first project
      • Creating an empty project
      • Setting up the database
      • Launching the development server
    • Summary
  • Chapter 3: Building a Social Bookmarking Application
    • A word about Django terminology
    • URLs and views: creating the main page
      • Creating the main page view
      • Creating the main page URL
    • Models: designing an initial database schema
      • The link data model
      • The user data model
      • The bookmark data model
    • Templates: creating a template for the main page
    • Putting it all together: generating user pages
      • Creating the URL
      • Writing the view
      • Designing the template
      • Populating the model with data
    • Summary
  • Chapter 4: User Registration and Management
    • Session authentication
      • Creating the login page
      • Enabling logout functionality
    • Improving template structure
    • User registration
      • Django forms
      • Designing the user registration form
    • Account management
    • Summary
  • Chapter 5: Introducing Tags
    • The tag data model
    • Creating the bookmark submission form
      • Restricting access to logged-in users
      • Methods for browsing bookmarks
      • Improving the user page
      • Creating a tag page
      • Building a tag cloud
    • A word on security
      • SQL injection
      • Cross-Site Scripting (XSS)
    • Summary
  • Chapter 6: Enhancing the User Interface with AJAX
    • AJAX and its advantages
    • Using an AJAX framework in Django
      • Downloading and installing jQuery
    • The jQuery JavaScript framework
      • Element selectors
      • jQuery methods
        • Hiding and showing elements
        • Accessing CSS properties and HTML attributes
        • Manipulating HTML documents
        • Traversing the document tree
        • Handling events
        • Sending AJAX requests
        • What next?
    • Implementing live searching of bookmarks
      • Implementing basic searching
      • Implementing live searching
    • Editing bookmarks in place
      • Implementing basic bookmark editing
      • Implementing in-place editing of bookmarks
    • Auto-completion of tags
    • Summary
  • Chapter 7: Voting and Commenting
    • Sharing bookmarks on the main page
      • The SharedBookmark data model
      • Modifying the bookmark submission form
      • Browsing and voting for shared bookmarks
      • The popular bookmarks page
    • Commenting on bookmarks
      • Enabling the comments application
      • Creating a view for comments
      • Displaying comments and a comment form
      • Creating comment templates
    • Summary
  • Chapter 8: Creating an Administration Interface
    • Activating the administration interface
    • Customizing the administration interface
      • Customizing listing pages
      • Overriding administration templates
    • Users, groups, and permissions
      • User permissions
      • Group permissions
      • Using permissions in views
    • Summary
  • Chapter 9: Advanced Browsing and Searching
    • Adding RSS feeds
      • Creating the recent bookmarks feed
        • Customizing item fields
      • Creating the user bookmarks feed
      • Linking feeds to HTML pages
    • Advanced searching
      • Retrieving objects with the database API
      • Advanced queries with Q objects
      • Improving the search feature
    • Organizing content into pages (pagination)
    • Summary
  • Chapter 10: Building User Networks
    • Building friend networks
      • Creating the friendship data model
      • Writing views to manage friends
        • The friends list view
        • Creating the add friend view
    • Inviting friends via email
      • The invitation data model
      • The Invite A Friend form and view
      • Handling activation links
    • Improving the interface with messages
    • Summary
  • Chapter 11: Extending and Deploying
    • Internationalization (i18n)
      • Marking strings as translatable
      • Creating translation files
      • Enabling and configuring the i18n system
    • Improving performance with caching
      • Enabling caching
        • Local memory caching
        • Database caching
        • File system caching
        • Memcached
      • Configuring caching
        • Caching the whole site
        • Caching specific views
      • Unit testing
      • The test client
      • Testing the registration view
    • Deploying Django
      • The production web server
      • The production database
      • Turning off debug mode
      • Changing configuration variables
      • Setting error pages
    • Summary
  • Chapter 12: What Next?
    • Custom template tags and filters
    • Model managers and custom SQL
    • Generic views
    • Contributed sub-frameworks
      • Flatpages
      • Sites
      • Markup filters
      • Humanize
      • Sitemaps
      • Cross-Site Request Forgery protection (CSRF)
    • Message system
    • Subscription system
    • User scores
    • Summary

Ayman Hourieh

Ayman Hourieh holds a bachelor degree in Computer Science. He joined the engineering team at Google in January 2008. Prior to that, he worked with web application development for more than two years. In addition, he has been contributing to several Open Source projects such as Mozilla Firefox. Ayman also worked as a teaching assistant in Computer Science courses for one year. Even after working with a variety of technologies, Python remains Ayman's favorite programming language. He found Django to be a powerful and flexible Python framework that helps developers to produce high-quality web applications in a short time.

Code Downloads

Download the code and support files for this book.

Submit Errata

Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.


- 2 submitted: last submission 07 Dec 2012

Errata type: Technical | Page number: 65 | Errata date: 22 July 11

"{{ form.as_pl }}" should be "{{form.as_pl() }}"


Errata type: Technical | Page number: 56 | Errata date: 22 July 11

"{% if form.has_errors %} " should be "{% if form.errors %}"


Sample chapters

You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

Frequently bought together

Django 1.0 Website Development +    Nmap 6: Network Exploration and Security Auditing Cookbook =
50% Off
the second eBook
Price for both: $34.95

Buy both these recommended eBooks together and get 50% off the cheapest eBook.

What you will learn from this book

  • Register your users through a user authentication system and manage them efficiently
  • Restrict user access to certain pages and protect against malicious input
  • Create tags to allow site visitors to classify, view, and share content easily
  • Create your own administration interface for proper monitoring of the web site
  • Enhance your user interface with AJAX and add flavors to your web site
  • Enable voting and commenting on content, and display popular content to site visitors
  • Build user networks; add friend management and invitation features for social networking
  • Create unit tests to automate the testing of code

In Detail

Django is a high-level Python web framework that was developed by a fast-moving online-news operation to meet the stringent twin challenges of newsroom deadlines and the needs of web developers. It is designed to promote rapid development and clean, pragmatic design and lets you build high-performing, elegant web applications rapidly. Django focuses on automating as much as possible and adhering to the DRY (Don’t Repeat Yourself) principle, making it easier to build high-performance web applications faster, with less code.

This book will show you how to assemble Django's features and take advantage of its power to design, develop, and deploy a fully-featured web site. It will walk you through the creation of an example web application, with lots of code examples.

Specially revised for version 1.0 of Django, the book starts by introducing the main design concepts in Django. Next, it leads you through the process of installing Django on your system. After that, you will start right away on building your social bookmarking application using Django. Various Django 1.0 components and sub-frameworks will be explained during this process, and you will learn about them by example.

In each chapter, you will build one or more of the features that are essential in Web 2.0 applications, like user management, tags, and AJAX. You will also learn about good software development practices, such as keeping your application secure, and automating testing with unit tests. By the end of the book, you will have built a fully functional real-life Web 2.0 application, and learned how to deploy it to a production server.

A beginner's guide to design, develop, and deploy a fully-featured dynamic website using the features of Django 1.0


The simple and clear approach is ideal for beginners to Django. Packed with examples and screenshots, this book will help you learn the features of Django 1.0 and help you build a dynamic website using those features.

Who this book is for

This book is for web developers who want to learn to build a complete site with Web 2.0 features, using the power of a proven and popular development system, Django, but do not necessarily want to learn how the complete framework functions in order to do this. Basic knowledge of Python development is required for this book, but no knowledge of Django is expected.

Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software