Free Sample
+ Collection

Django Essentials

Starting
Samuel Dauzon

Develop simple web applications with the powerful Django framework.
$13.99
$22.99
RRP $13.99
RRP $22.99
eBook
Print + eBook

Want this title & more?

$16.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781783983704
Paperback172 pages

About This Book

  • Get to know MVC pattern and the structure of Django
  • Create your first webpage with Django mechanisms
  • Enable user interaction with forms
  • Program extremely rapid forms with Django features.
  • Explore the best practices to develop applications of a superior quality

Who This Book Is For

This is an ideal book for developers who want to improve the quality and maintenance of their web application, and who already have knowledge of Python and web development.

Table of Contents

Chapter 1: Django's Position on the Web
From Web 1.0 to Web 2.0
What is Django?
The MVC framework
Why use Django?
Summary
Chapter 2: Creating a Django Project
Installing Python 3
Installing setuptools
Installing PIP
Installing Django
Starting your project with Django
Creating an application
Configuring the application
Summary
Chapter 3: Hello World! with Django
Routing in Django
Regular expressions
Creating our first URL
Creating our first view
Testing our application
Summary
Chapter 4: Working with Templates
Displaying Hello world! in a template
Injecting the data from the view to the template
Creating dynamic templates
Integrating variables in templates
Using filters
Creating DRY URLs
Extending the templates
Using static files in templates
Summary
Chapter 5: Working with Models
Databases and Django
Migrations with South
Creating simple models
The relationship between the models
Extending models
The admin module
Advanced usage of models
Summary
Chapter 6: Getting a Model's Data with Querysets
The persisting model's data on the database
Getting data from the database
Using the get parameter
Saving the foreign key
Updating records in the database
Deleting a record
Getting linked records
Advanced usage of the queryset
Summary
Chapter 7: Working with Django Forms
Adding a developer without using Django forms
Adding a developer with Django forms
The form based on a model
Advanced usage of Django forms
Summary
Chapter 8: Raising Your Productivity with CBV
The CreateView CBV
Working with ListView
The DetailView CBV
The UpdateView CBV
The DeleteView CBV
Going further by extending the CBV
Summary
Chapter 9: Using Sessions
Creating and getting session variables
About session security
Summary
Chapter 10: The Authentication Module
How to use the authentication module
Adding a user
Login and logout pages
Restricting access to the connected members
Summary
Chapter 11: Using AJAX with Django
Working with jQuery
jQuery basics
Working with AJAX in the task manager
Summary
Chapter 12: Production with Django
Completing the development
Selecting the physical server
Selecting the server software
Selecting the server database
Deploying the Django website
Installing Django, South, Gunicorn, and psycopg2
Summary

What You Will Learn

  • Utilize the MVC pattern to create web applications
  • Use Django models to store information in the database and generate queries to access a database across models
  • Generate very maintainable forms with Django
  • Quickly develop web pages to create, read, update, and delete data from the model using class-based views
  • Construct users by using an authentication module to restrict access to certain pages
  • Use AJAX with Django
  • Install your website on Linux and access it through the Internet

In Detail

Django is a powerful Python web framework designed for rapid web application development. With the advent of frameworks such as Django, web developers have been forced to adopt MVC architectures and are encouraged to develop quality code. This quality allows several developers to work together easily and reduces the number of bugs due to human errors.

Beginning with the basics of the Web and Django, the book explains the MVC pattern. It then moves on to explain the step-by-step installation of Python, PIP, and Django on Windows, Linux, and Mac OS. Furthermore, you will learn how to create templates, models, forms, and so on. After reading the book, you will be able to quickly create dynamic web applications with AJAX and an admin part.

This book features a step-by-step approach that shows you how to program, create, and improve the quality of web applications using Django, with the help of Python.

Authors

Read More

Recommended for You

Web Development with Django Cookbook
$ 29.99
Instant Django 1.5 Application Development Starter
$ 12.99
Django JavaScript Integration: AJAX and jQuery
$ 26.99