1.Overview
- 1.1Why Work with this Book?
- 1.2What you will Learn
- 1.3Technologies and Services
- 1.4Rango: Initial Design and Specification
- 1.5Summary
2.Getting Ready to Tango
- 2.1Python 3
- Django 2.0, 2.1 or 2.2?
- Python Skills Rusty?
- 2.2Virtual Environments
- 2.3The Python Package Manager
- 2.4Integrated Development Environment
- 2.5Version Control
- 2.6Testing your Implementation
3.Django Basics
- 3.1Testing Your Setup
- 3.2Creating Your Django Project
- 3.3Creating a Django App
- 3.4Creating a View
- 3.5Mapping URLs
- 3.6Basic Workflows
4.Templates and Media Files
- 4.1Using Templates
- 4.2Serving Static Media Files
- 4.3Serving Media
- 4.4Basic Workflow
5.Models and Databases
- 5.1Rango’s Requirements
- 5.2Telling Django about Your Database
- 5.3Creating Models
- 5.4Creating and Migrating the Database
- 5.5Django Models and the Shell
- 5.6Configuring the Admin Interface
- 5.7Creating a Population Script
- 5.8Workflow: Model Setup
6.Models, Templates and Views
- 6.1Workflow: A Data-Driven Page
- 6.2Showing Categories on Rango’s Homepage
- 6.3Creating a Details Page
- Exercises
7.Forms
- 7.1Basic Workflow
- 7.2Page and Category Forms
8.Working with Templates
- 8.1Using Relative URLs in Templates
- 8.2Dealing with Repetition
- 8.3Template Inheritance
- 8.4The
render()Method and therequestContext - 8.5Custom Template Tags
- 8.6Summary
9.User Authentication
- 9.1Setting up Authentication
- 9.2Password Hashing
- 9.3Password Validators
- 9.4The
UserModel - 9.5Additional
UserAttributes - 9.6Creating a User Registration View and Template
- 9.7Implementing Login Functionality
- 9.8Restricting Access
- 9.9Logging Out
- 9.10Tidying up the
base.htmlHyperlinks - 9.11Taking it Further
10.Cookies and Sessions
- 10.1Cookies, Cookies Everywhere!
- 10.2Sessions and the Stateless Protocol
- 10.3Setting up Sessions in Django
- 10.4A Cookie Tasting Session
- 10.5Client-Side Cookies: A Site Counter Example
- 10.6Session Data
- 10.7Browser-Length and Persistent Sessions
- 10.8Clearing the Sessions Database
- 10.9Basic Considerations and Workflow
11.User Authentication with Django-Registration-Redux
- 11.1Setting up Django Registration Redux
- 11.2Functionality and URL mapping
- 11.3Setting up the Templates
12.Bootstrapping Rango
- 12.1The Template
- 12.2Quick Style Change
13.Adding Search to Rango
- 13.1The Bing Search API
- 13.2Adding Search Functionality
- 13.3Putting Search into Rango
14.Making Rango Tango Exercises
- 14.1Tracking Page Clickthroughs
- 14.2Searching Within a Category Page
- 14.3Create and View User Profiles
15.Making Rango Tango Hints
- 15.1Track Page Clickthroughs
- 15.2Searching Within a Category Page
- 15.3Creating a
UserProfileInstance - 15.4Class-Based Views
- 15.5Viewing your Profile
- 15.6Listing all Users
16.JQuery Crash Course
- 16.1Including JQuery
- 16.2Testing your Setup
- 16.3Further DOM Manipulation Examples
- 16.4Debugging Hints
17.AJAX in Django with JQuery
- 17.1AJAX and Rango
- 17.2Adding a “Like” Button
- 17.3Adding Inline Category Suggestions
- 17.4Further AJAX-ing
18.Automated Testing
- 18.1Running Tests
- 18.2Examining Testing Coverage
19.Deploying Your Project
- 19.1Creating a PythonAnywhere Account
- 19.2The PythonAnywhere Web Interface
- 19.3Creating a Virtual Environment
- 19.4Setting up your Web Application
- 19.5Log Files
20.Final Thoughts
- 20.1Acknowledgements
Appendices
Setting up your System
- Installing Python 3 and
pip - Assumption of Knowledge
- Virtual Environments
workonanddeactivate- Multiple Python Versions
- 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