Tango With Django 2
Tango With Django 2
$14.99
Minimum price
$24.99
Suggested price
Tango With Django 2

This book is 92% complete

Last updated on 2019-04-16

About the Book

This is the fourth edition of Tango with Django which has now been upgraded to Django 2+ using Python 3+. The book was first launched in October 2013 by Dr. Leif Azzopardi and David Maxwell while teaching web development at the University of Glasgow. The book has been used as the course text ever since. Previous editions of the book are freely available at: www.tangowithdjango.com which has enjoyed by over two million visitors!

In this edition you will learn how to build web applications use Django by building a simple app called Rango, a directory of categories and links. Through the process you will learn how to setup your Django projects, create models, views and mappings, as well as user authentication, templates, class based views and testing. Through out the book we provide workflows to get you into the Django mindset, reducing the learning curve, explaining the how's and why's of software development, and advocating best practices when developing your web apps. In addition to how to develop with Django, we've included chapters that explain how to incorporate CSS and Twitter's Bootstrap, Javascript and JQuery, and how to integrate external services link Microsoft Azure's Bing Search API, as well as how to deploy your Django application to PythonAnywhere.com.

So, if you want to learn Django and build web applications, then Tango with Django provides an all round end-to-end guide for beginners.

About the Authors

Leif Azzopardi
Leif Azzopardi

Leif Azzopardi is passionate about Web Development, Web Design, Information Architecture and Software Engineering. His research interests are focused on Information Retrieval and Search Engine Technologies.

David Maxwell
David Maxwell

David Maxwell is a PhD Candidate at the University of Glasgow, who teaches Python and Web Development. His research also focuses on Information Retrieval.

Table of Contents

  • Overview
    • Why Work with this Book?
    • What you will Learn
    • Technologies and Services
    • Rango: Initial Design and Specification
    • Summary
  • Getting Ready to Tango
    • Python 3
    • Virtual Environments
    • The Python Package Manager
    • Integrated Development Environment
    • Version Control System
  • Django Basics
    • Testing Your Setup
    • Creating Your Django Project
    • Creating a Django App
    • Creating a View
    • Mapping URLs
    • Basic Workflows
  • Templates and Media Files
    • Using Templates
    • Serving Static Media Files
    • Serving Media
    • Basic Workflow
  • Models and Databases
    • Rango’s Requirements
    • Telling Django about Your Database
    • Creating Models
    • Creating and Migrating the Database
    • Django Models and the Shell
    • Configuring the Admin Interface
    • Creating a Population Script
    • Workflow: Model Setup
  • Models, Templates and Views
    • Workflow: Data Driven Page
    • Showing Categories on Rango’s Homepage
    • Creating a Details Page
  • Forms
    • Basic Workflow
    • Page and Category Forms
  • Working with Templates
    • Using Relative URLs in Templates
    • Dealing with Repetition
    • Template Inheritance
    • The render() Method and the request Context
    • Custom Template Tags
    • Summary
  • User Authentication
    • Setting up Authentication
    • Password Hashing
    • Password Validators
    • The User Model
    • Additional User Attributes
    • Creating a User Registration View and Template
    • Implementing Login Functionality
    • Restricting Access
    • Logging Out
    • Taking it Further
  • Cookies and Sessions
    • Cookies, Cookies Everywhere!
    • Sessions and the Stateless Protocol
    • Setting up Sessions in Django
    • A Cookie Tasting Session
    • Client Side Cookies: A Site Counter Example
    • Session Data
    • Browser-Length and Persistent Sessions
    • Clearing the Sessions Database
    • Basic Considerations and Workflow
  • User Authentication with Django-Registration-Redux
    • Setting up Django Registration Redux
    • Functionality and URL mapping
    • Setting up the Templates
  • Bootstrapping Rango
    • Template
    • Quick Style Change
  • Template Tags
    • Providing Categories on Every Page
  • Search
    • The Bing Search API
    • Adding Search Functionality
    • Putting Search into Rango
  • Making Rango Tango! Exercises
    • Track Page Clicks
    • Searching Within a Category Page
    • Create and View Profiles
  • Making Rango Tango! Hints
    • Track Page Clickthroughs
    • Searching Within a Category Page
    • Creating a UserProfile Instance
    • Class Based Views
    • Viewing your Profile
    • Listing all Users
  • JQuery and Django
    • Including JQuery in Your Django Project/App
    • DOM Manipulation Example
  • AJAX in Django with JQuery
    • AJAX based Functionality
    • Add a Like Button
    • Adding Inline Category Suggestions
  • Automated Testing
    • Running Tests
    • Coverage Testing
  • Deploying Your Project
    • Creating a PythonAnywhere Account
    • The PythonAnywhere Web Interface
    • Creating a Virtual Environment
    • Setting up Your Web Application
    • Log Files
  • Final Thoughts
    • Acknowledgements
  • Appendices
  • Setting up your System
    • Installing Python 3 and pip
    • Virtual Environments
    • Using pip
    • Version Control System
  • A Crash Course in UNIX-based Commands
    • Using the Terminal
    • Core Commands
  • A Git Crash Course
    • Why Use Version Control?
    • How Git Works
    • Setting up Git
    • Basic Commands and Workflow
    • Recovering from Mistakes
  • A CSS Crash Course
    • Including Stylesheets
    • Basic CSS Selectors
    • Element Selectors
    • Fonts
    • Colours and Backgrounds
    • Containers, Block-Level and Inline Elements
    • Basic Positioning
    • The Box Model
    • Styling Lists
    • Styling Links
    • The Cascade
    • Additional Reading
  • Notes

The Leanpub 45-day 100% Happiness Guarantee

Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms

Free Updates. Free App. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers), EPUB (for phones and tablets), MOBI (for Kindle) and in the free Leanpub App (for Mac, Windows, iOS and Android). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

Authors, publishers and universities use Leanpub to publish amazing in-progress and completed books and courses, just like this one. You can use Leanpub to write, publish and sell your book or course as well! Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks. Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. It really is that easy.

Learn more about writing on Leanpub