Navigation
next
How to Tango with Django 1.7
»
Table Of Contents
How To Tango With Django 1.7
Indices and tables
Next topic
1. New in TwD 1.7
This Page
Show Source
Quick search
Enter search terms or a module, class or function name.
How To Tango With Django 1.7
¶
1. New in TwD 1.7
2. Overview
2.1. Why Work with this Book?
2.2. What You will Learn
2.3. Technologies and Services
2.4. Rango: Initial Design and Specification
2.4.1. Design Brief
2.5. Exercises
2.6. N-Tier Architecture
2.7. Wireframes
2.8. Pages and URL Mappings
2.9. Entity-Relationship Diagram
2.10. Summary
2.10.1. Working with The Official Django Tutorials
3. Getting Ready to Tango
3.1. Using the Terminal
3.1.1. Core Commands
3.2. Installing the Software
3.2.1. Installing Python
3.2.2. Setting Up the
PYTHONPATH
3.2.3. Using Setuptools and Pip
3.2.4. Installing Django
3.2.5. Installing the Python Imaging Library
3.2.6. Installing Other Python Packages
3.2.7. Sharing your Package List
3.3. Integrated Development Environment
3.3.1. Virtual Environments
3.3.2. Code Repository
3.4. Exercises
4. Django Basics
4.1. Testing your Setup
4.2. Creating your Django Project
4.3. Creating a Django Application
4.4. Creating a View
4.5. Mapping URLs
4.6. Basic Workflows
4.6.1. Creating a new Django Project
4.6.2. Creating a new Django application
4.7. Exercises
4.7.1. Hints
5. Templates and Static Media
5.1. Using Templates
5.1.1. Configuring the Templates Directory
5.1.2. Dynamic Paths
5.1.3. Adding a Template
5.2. Serving Static Media
5.2.1. Configuring the Static Media Directory
5.3. Static Media Files and Templates
5.4. The Static Media Server
5.5. Basic Workflow
5.6. Exercises
6. Models and Databases
6.1. Rango’s Requirements
6.2. Telling Django About Your Database
6.3. Creating Models
6.4. Creating and Migrating the Database
6.4.1. Setup Database and Create Superuser
6.4.2. Creating / Updating Models / Tables
6.5. Django Models and the Django Shell
6.6. Configuring the Admin Interface
6.7. Creating a Population Script
6.8. Basic Workflows
6.8.1. Setting up your Database
6.8.2. Adding a Model
6.9. Exercises
6.9.1. Hints
7. Models, Templates and Views
7.1. Basic Workflow: Data Driven Pages
7.2. Showing Categories on Rango’s Homepage
7.2.1. Importing Required Models
7.2.2. Modifying the Index View
7.2.3. Modifying the Index Template
7.3. Creating a Details Page
7.3.1. URL Design and Mapping
7.3.2. Update Category Table with Slug Field
7.3.3. Category Page Workflow
7.3.4. Category View
7.3.5. Category Template
7.3.6. Parameterised URL Mapping
7.3.7. Modifying the Index Template
7.3.8. Demo
7.4. Exercises
7.4.1. Hints
8. Fun with Forms
8.1. Basic Workflow
8.2. Page and Category Forms
8.2.1. Creating
ModelForm
Classes
8.2.2. Creating an
Add Category
View
8.2.3. Creating the
Add Category
Template
8.2.4. Mapping the
Add Category
View
8.2.5. Modifying the Index Page View
8.2.6. Demo
8.2.7. Cleaner Forms
8.3. Exercises
8.3.1. Creating an
Add Pages
View, Template and URL Mapping
8.3.2. Hints
9. User Authentication
9.1. Setting up Authentication
9.2. The
User
Model
9.3. Additional User Attributes
9.4. Creating a
User Registration
View and Template
9.4.1. Creating the
UserForm
and
UserProfileForm
9.4.2. Creating the
register()
View
9.4.3. Creating the
Registration
Template
9.4.4. The
register()
View URL Mapping
9.4.5. Linking Together
9.4.6. Demo
9.5. Adding Login Functionality
9.5.1. Creating the
login()
View
9.5.2. Creating a
Login
Template
9.5.3. Mapping the Login View to a URL
9.5.4. Linking Together
9.5.5. Demo
9.6. Restricting Access
9.6.1. Restricting Access with a Decorator
9.7. Logging Out
9.8. Exercises
10. Working with Templates
10.1. Reoccurring HTML and The Base Template
10.2. Template Blocks
10.2.1. Abstracting Further
10.3. Template Inheritance
10.4. Referring to URLs in Templates
10.5. Exercises
11. Cookies and Sessions
11.1. Cookies, Cookies Everywhere!
11.2. Sessions and the Stateless Protocol
11.3. Setting up Sessions in Django
11.4. A Cookie Tasting Session
11.4.1. Testing Cookie Functionality
11.5. Client Side Cookies: A Site Counter Example
11.6. Session Data
11.7. Browser-Length and Persistent Sessions
11.8. Clearing the Sessions Database
11.9. Basic Considerations and Workflow
11.10. Exercises
11.10.1. Hint
12. User Authentication with Django-Registration-Redux
12.1. Setting up Django Registration Redux
12.2. Functionality and URL mapping
12.3. Setting up the Templates
12.3.1. Login Template
12.3.2. Registration Template
12.3.3. Registration Complete Template
12.3.4. Logout Template
12.3.5. Try out the Registration Process
12.3.6. Refactoring your project
12.3.7. Modifying the Registration Flow
12.4. Exercises
13. Bootstrapping Rango
13.1. The New Base Template
13.2. Quick Style Change
13.2.1. The Index Page
13.3. The Login Page
13.3.1. Other Form-based Templates
13.4. The Registration Template
13.5. Using Django-Bootstrap-Toolkit
13.6. The End Result
14. Template Tags
14.1. Providing Categories on Every Page
14.2. Using Template Tags
14.3. Parameterised Template Tags
15. Adding External Search Functionality
15.1. The Bing Search API
15.1.1. Registering for a Bing API Key
15.2. Adding Search Functionality
15.3. Storing your API KEY safely
15.4. Exercises
15.5. Putting Search into Rango
15.5.1. Adding a Search Template
15.5.2. Adding the View
16. Making Rango Tango! Exercises
16.1. Track Page Click Throughs
16.1.1. Hint
16.2. Searching Within a Category Page
16.3. Create and View Profiles
17. Making Rango Tango! Code and Hints
17.1. Track Page Click Throughs
17.1.1. Creating a URL Tracking View
17.1.2. Mapping URL
17.1.3. Updating the Category Template
17.1.4. Updating Category View
17.2. Searching Within a Category Page
17.2.1. Decommissioning Generic Search
17.2.2. Creating a Search Form Template
17.2.3. Updating the Category View
18. JQuery and Django
18.1. Including JQuery in your Django Project/Application
18.1.1. Stylistic Note
18.2. Example Popup Box on Click
18.3. Selectors
18.4. DOM Manipulation Example
19. AJAX in Django with JQuery
19.1. AJAX based Functionality
19.2. Add a “Like Button”
19.2.1. Workflow
19.2.2. Updating Category Template
19.2.3. Create a Like Category View
19.2.4. Making the AJAX request
19.3. Adding Inline Category Suggestions
19.3.1. Workflow
19.3.2. Parameterise the Get Category List Function
19.3.3. Create a Suggest Category View
19.3.4. Map View to URL
19.3.5. Update Base Template
19.3.6. Add AJAX to Request Suggestions
19.4. Exercises
19.4.1. Hints
20. Automated Testing
20.1. Running Tests
20.2. Testing the models in Rango
20.3. Testing Views
20.4. Testing the Rendered Page
20.5. Coverage Testing
20.6. Exercises
21. Deploying Your Project
21.1. Creating a PythonAnywhere Account
21.2. The PythonAnywhere Web Interface
21.3. Creating a Virtual Environment
21.3.1. Virtual Environment Switching
21.4. Cloning your Git Repository
21.4.1. Setting Up the Database
21.5. Setting up your Web Application
21.5.1. Configuring the WSGI Script and its virtual environment
21.5.2. Assigning Static Paths
21.5.3. Bing API Key
21.5.4. Turning off
DEBUG
Mode
21.6. Log Files
21.7. Exercises
22. Summary
23. A Git Crash Course
23.1. Why Use Version Control?
23.2. Git on Windows
23.3. The Git System
23.4. Setting up Git
23.4.1. How to Clone a Remote Repository
23.4.2. The Directory Structure
23.4.3. Final Tweaks
23.5. Basic Commands and Workflow
23.5.1. 1. Starting Off
23.5.2. 2. Doing Some Work!
23.5.3. 3. Committing your Changes
23.5.4. 4. Synchronising your Repository
23.5.5. 5. Pushing your Commit(s)
23.6. Recovering from Mistakes
23.7. Exercises
24. A CSS Crash Course
24.1. Including Stylesheets
24.2. Basic CSS Selectors
24.3. Element Selectors
24.3.1. ID Selectors
24.3.2. Class Selectors
24.4. Fonts
24.5. Colours and Backgrounds
24.5.1. Text Colours
24.5.2. Borders
24.5.3. Background Colours
24.5.4. Background Images
24.6. Containers, Block-Level and Inline Elements
24.6.1. Block-Level Elements
24.6.2. Inline Elements
24.7. Basic Positioning
24.7.1. Floats
24.7.2. Relative Positioning
24.7.3. Absolute Positioning
24.8. The Box Model
24.9. Styling Lists
24.10. Styling Links
24.11. The Cascade
24.12. Additional Reading
25. Acknowledgements
26. Javascript and JQuery
27. Virtual Environments
Indices and tables
¶
Index
Module Index
Search Page
Navigation
next
How to Tango with Django 1.7
»