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
- 2.2The Python Package Manager
- 2.3Virtual Environments
- 2.4Integrated Development Environment
- 2.5Code Repository
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: 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.10Taking 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.1Template
- 12.2Quick Style Change
- 12.3Using
Django-Bootstrap-Toolkit
13.Webhose Search
- 13.1The Webhose API
- 13.2Adding Search Functionality
- 13.3Putting Webhose Search into Rango
14.Making Rango Tango! Exercises
- 14.1Track Page Clickthroughs
- 14.2Searching Within a Category Page
- 14.3Create and View Profiles
15.Making Rango Tango! Hints
- 15.1Track Page Clickthroughs
- 15.2Searching Within a Category Page
- 15.3Creating a
UserProfileInstance - 15.4Viewing your Profile
- 15.5Listing all Users
16.JQuery and Django
- 16.1Including JQuery in Your Django Project/App
- 16.2DOM Manipulation Example
17.AJAX in Django with JQuery
- 17.1AJAX based Functionality
- 17.2Add a Like Button
- 17.3Adding Inline Category Suggestions
18.Automated Testing
- 18.1Running Tests
- 18.2Coverage Testing
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
- Setting Up the
PYTHONPATH - Using
setuptoolsandpip - Virtual Environments
- Version Control
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