𝔖 Scriptorium
✦   LIBER   ✦

📁

Tango with Django 2: A beginner’s guide to web development with Django 2 (v.2020-01a)

✍ Scribed by Leif Azzopardi, David Maxwell


Publisher
leanpub.com
Year
2020
Tongue
English
Leaves
438
Category
Library

⬇  Acquire This Volume

No coin nor oath required. For personal study only.

✦ Synopsis


This is the fourth edition of Tango with Django which has now been heavily revised and upgraded to make use of Django 2.x using Python 3.x. The book was first launched in October 2013 by Dr. Leif Azzopardi and Dr. David Maxwell while both were teaching web development at the University of Glasgow. The book has been used as the course text ever since, with literally thousands of undergraduate and postgraduate students using it over the years. Previous editions of the book are freely available at: www.tangowithdjango.com which has been used 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. Throughout the book, we provide workflows to get you into the Django mindset, reducing the learning curve, explaining the hows and whys 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, like Microsoft Azure's Bing Search API. We also cover 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.

✦ Table of Contents


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
Testing your Implementation
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: A 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
Tidying up the base.html Hyperlinks
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
The Template
Quick Style Change
Adding Search to Rango
The Bing Search API
Adding Search Functionality
Putting Search into Rango
Making Rango Tango Exercises
Tracking Page Clickthroughs
Searching Within a Category Page
Create and View User 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 Crash Course
Including JQuery
Testing your Setup
Further DOM Manipulation Examples
Debugging Hints
AJAX in Django with JQuery
AJAX and Rango
Adding a ``Like'' Button
Adding Inline Category Suggestions
Further AJAX-ing
Automated Testing
Running Tests
Examining Testing Coverage
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


📜 SIMILAR VOLUMES


Tango With Django 2: A beginner’s guide
✍ Leif Azzopardi and David Maxwell 📂 Library 📅 2019 🏛 leanpub.com 🌐 English

This is the fourth edition of Tango with Django which has now been heavily revised and upgraded to make use of Django 2.x using Python 3.x. The book was first launched in October 2013 by Dr. Leif Azzopardi and Dr. David Maxwell while both were teaching web development at the University of Glasgow. T

Tango With Django: A beginner’s Guide to
✍ Leif Azzopardi, David Maxwell 📂 Library 📅 2017 🏛 Leanpub 🌐 English

Tango with Django is a beginner's guide to web development using the Python programming language and the popular Django web framework. The book is written in a clear and friendly style teaching you the basics of web development through a step-by-step guide. Along the way a series of exercises are pr

Django for Beginners: Learn Web Developm
✍ William S. Vincent 📂 Library 📅 2018 🌐 English

Django for Beginners takes you from total beginner to confident Django developer. Proceed step-by-step through five progressively more complex web applications: from a "Hello World" app all the way to a robust Newspaper app with a custom user model, complete user authentication flow, foreign key rel

How to Tango with Django 1.9/1.10/1.11:
✍ Leif Azzopardi and David Maxwell 📂 Library 📅 2018 🏛 leanpub.com 🌐 English

Tango with Django is a beginner's guide to web development using the Python programming language and the popular Django framework 1.9 (also compatible with 1.10 and 1.11). The book teaches you the basics through a step-by-step guide, and is written in a clear, friendly way. A series of exercises can

Web Development with Django: A definitiv
✍ Ben Shaw | Saurabh Badhwar | Chris Guest | Bharath Chandra K S 📂 Library 📅 2023 🏛 Packt Publishing Pvt Ltd 🌐 English

Do you want to develop reliable and secure applications that stand out from the crowd without spending hours on boilerplate code? You've made the right choice trusting the Django framework, and this book will tell you why. Often referred to as a “batteries included” web development framework, Django