Symbols
__str__() method 13
__unicode__() method 14
A
abstract model 367
activity stream
add() method, parameters
override_quantity 243
product 243
quantity 243
administration site
creating, for models 16
custom actions, adding 285, 286, 287
Django administration site 17
extending, with custom views 288, 291
superuser, creating 16
administration templates
reference link 291
aggregation
reference link 66
aggregation functions
average value (Avg) 66
count value (Count) 66
maximum value (Max) 66
minimum value (Min) 66
reference link 72
AJAX actions
AJAX GET request, scenario
response, with data
response, with no content
AJAX pagination
AJAX requests
performing, with jQuery 180, 182, 183
with cross-site request forgery (CSRF) 177, 179
AJAX view
building, to follow users 196, 197, 198
ALLOWED_HOSTS setting
application 10
application configuration classes
reference link 215
asynchronous applications
ASGI, using 471
asynchronous consumer
Asynchronous Server Gateway Interface (ASGI) 2, 521
asynchronous tasks
adding, to application
launching, with Celery 266
authentication backend, methods
authenticate() 134
get_user() 134
B
base classes, Django
Form 40
Model Form 40
blog data schema
application, activating 14
blog data schema, fields
author 13
body 13
created 13
publish 13
slug 12
status 13
title 12
updated 13
blog posts
used, for creating feeds 81, 82
bookmarklet
building, with jQuery 162, 163, 165, 166, 167, 168, 169
Braintree
integrating, with Hosted Fields 275, 276, 277, 278, 280, 281
URL 270
Braintree account
creating 284
reference link 284
Braintree Python module
Braintree sandbox account
reference link 271
built-in authentication views
reference link 104
built-in signals
reference link 212
built-in template tags and filters
reference link 68
built-in template, tags and filters
reference link 32
C
cache framework
cache levels 438
cache settings 436
low-level cache API, using 438, 439, 441
Memcached backend, adding to project 436
Memcached backend, installing 435
template fragments, caching
using 434
views, caching
cache levels
about 438
low-level cache API 438
per-site cache 438
per-view cache 438
template cache 438
cache settings 436
canonical URL
for models 30
CartAddProductForm class, fields
override 247
quantity 247
cart detail page 349
catalog templates
Celery
adding, to project 267
asynchronous tasks, launching 266
installing 266
monitoring
reference link 266
certification authority (CA) 518
channel layer
consumer, updating to broadcast messages 487, 488, 489, 490, 491
context, adding to messages 491, 493, 494
enabling 484
setting up, with Redis 484, 487
channel layer, abstractions
channel 484
group 484
Channels
using, in Real-time Django 471
using, in request/response cycle 472, 473
chat application
chat room view
chat server
implementing 475
integrating, with existing views 496
class-based views
access, restricting 388, 389, 390, 391, 392, 393, 394
features 37
reference link 38
comma-separated values (CSV) 285
comment system
comments, adding to post detail template 55, 56, 58, 59
creating 51
forms, creating from models 53
ModelForms, handling in views 54, 55
consumer
content
posting, from other websites 154, 155
content management system (CMS)
authentication system, adding 378
authentication templates, creating 379, 380, 382
class-based views, creating 383
creating 378
groups, working with 387
mixins, using for class-based views 383, 384, 386
permissions, working with 387, 388
contents of directory
reference link 164
contenttypes framework
reference link 201
context processor
about 254
creating 254
reference link 255
shopping cart, setting into request context 255, 256
coupon
applying, to shopping cart 304, 305, 306, 308, 309, 310, 311
coupon model
coupon system
creating 301
course contents
course models
content model, creating 369, 370
creating, for diverse content 366
custom model fields, creating 371, 373
fixtures, used for providing initial data 363, 365
model inheritance, using 367
OrderField class, adding to content objects 374, 375, 376, 377, 378
OrderField class, adding to module 373, 375, 376, 377, 378
registering, in administration site 361
course modules
content, adding 399, 401, 404, 406
contents, managing 394, 406, 408, 409, 410
contents, reordering 411
formsets, using 394, 395, 397, 398, 399
managing 394, 406, 408, 409, 410
reordering 411
courses
displaying 414, 415, 417, 418, 419
credit cards, testing
reference link 283
cron
about
reference link
cross-site request forgery (CSRF)
about 46
reference link 46
CSRF protection
referemce link 179
CSV files
orders, exporting to 285
CSV files, generating with Django
reference link 288
curl
download link 449
custom actions
adding, to administration site 285, 286, 287
custom authentication backend
custom decorators
customer orders
creating 260, 261, 262, 264, 265, 266
order models, creating 257, 258
order models, in administration site 259, 260
registering 257
customizing authentication
reference link 134
custom management commands
reference link
custom model fields, writing
reference link 373
custom template filters
creating 68
reference link 76
custom template tags
creating 68
reference link 73
custom user model
using 130
custom views
used, for extending administration site 288, 291
Cygwin
URL 504
D
database, executing with Django
reference link 2
database indexes
reference link 151
decorators, concept
reference link 183
detail views
building 27
canonical URL, for models 30
creating, for user profiles 191, 192, 193, 194
directory contents
reference link 234
directory's contents
reference link 32
dispatch() method 401
Django
installation link 4
installing 2
installing, with pip package 3, 4
language, determining 316, 317
translations, adding 316
used, for creating forms 40, 41
used, for sending emails 43, 44, 45
used, in internationalization 315
Django application
about 10
creating 11
Django authentication framework
authentication views, using 103, 104
login view, creating 97, 98, 100, 101, 102, 103
login views 106, 107, 108, 110, 112
logout views 104, 106, 107, 108, 110, 112
password views, changing 113, 114, 115
password views, resetting 115, 116, 117, 118, 119
using 96
Django authentication framework, models
group model 97
permission 97
user model 97
django-braces
mixins, using 411
reference link 411
Django, deploying with web servers
reference link 7
Django, developing with ASGI
reference link 472
django-embed-video application's documentation
reference link 433
Django, field types
reference link 13
django-localflavor
using, to validate form fields 347, 348
django-parler
installing 338
translations, integrating into administration site 341
used, for translating models 338
django-parler module's compatibility, with Django
reference link 341
Django project
about 10
check management command 502
connections, securing with SSL/TLS certificate 516
custom management commands, implementing
Daphne, executing in NGINX configuration 523, 524, 525
Daphne, using for Django Channels 521, 522
development server, executing 6, 7
multiple environments settings, managing 498, 499, 501
NGINX, configuring 509, 510, 512
NGINX, installing 508
production environment, creating 497, 509
secure connections, using for WebSockets 522
serving, through WSGI 502, 504
static and media assets, serving 514, 515, 516
uWSGI, configuring 504, 505, 507, 508
uWSGI, installing 504
Django project, settings
about 9
ALLOWED_HOSTS 9
DATABASES 9
DEBUG 9
INSTALLED_APPS 9
LANGUAGE_CODE 10
MIDDLEWARE 9
reference link 9
ROOT_URLCONF 9
USE_TZ 10
Django REST framework
reference link 444
Django REST framework, features
reference link 463
Django REST framework, settings
reference link 445
Django's built-in template filters
reference link 73
Django's cache system
reference link 434
Django sessions
expiration 241
settings 239
used, for storing shopping carts 241, 242, 243, 246
using 238
Django syndication feed framework
reference link 83
Django, tagging
reference link 60
django-taggit managers
reference link
Django template language
reference link 31
Document Object Model (DOM) 177
duplicate actions
avoiding, in activity stream 205, 206
dynamic data
E
easy-thumbnails
reference link 175
used, for creating image thumbnails 172, 173
e-learning project
setting up 358
emails
sending, with Django 43, 44, 45
F
Facebook developer account
reference link 140
features, URL patterns
language prefix 334
translated 334
feeds
creating, for blog posts 81, 82
fields, Action model
created 199
target 202
target_ct 202
target_id 202
user 199
verb 199
fields, ContentType model
app_label 200
model 200
name 200
fields, generic relations in model
ForeignKey field 201
GenericForeignKey field 201
PositiveIntegerField 201
fixtures 363
fixtures usage, for testing
reference link 365
Flower dashboard
reference link
follow system
AJAX view, building to follow users 196, 197, 198
building 187
detail views, creating for user profiles 191, 192, 193, 194, 195
list views, creating for user profiles 191, 192, 193, 194, 195
many-to-many relationships, creating with intermediary model 188, 189, 190, 191
ForeignKey
reference link 13
reference link 347
form fields
reference link 41
forms
rendering, in templates 45, 46, 48, 49, 50
formsets
reference link 395
full-text search
adding, to blog 83
reference link 91
full-text search engines 92
Fuzzy translations 333
G
generic activity stream application
activity stream, displaying 207, 208
contenttypes framework, using 200, 201
duplicate actions, avoiding in activity stream 205, 206
generic relations, adding to model 201, 202, 204, 205
QuerySets, optimizing 208
templates, creating for actions 209, 210, 211
user actions, adding to activity stream 206, 207
generic mixins and views
reference link 447
generic relations
adding, to model 201, 202, 204, 205
get_form() method 401
get() method 401
get_model() method 400
Gmail captcha, disabling
reference link 44
Google's OAuth2 implementation
reference link 148
H
Haystack
reference link 92
Homebrew
download link 435
I
image bookmarking website
creating 150
image model, building 150, 151
image model, registering in administration site 154
many-to-many relationships, creating 153
image model
registering, in administration site 154
image ranking
storing, in Redis 224
images
detail view, creating 170, 172
image thumbnails
creating, with easy-thumbnails 172, 173
internationalization
about 314
adding 314
management commands 316
with Django 315
item views
storing, with Redis 218
J
jQuery
download link 177
loading 176
referene link 162
used, for adding AJAX actions 175, 176
used, for building bookmarklet 162, 163, 164, 165, 166, 167, 168, 169
used, for performing AJAX requests 180, 181, 182, 183
jQuery selectors
reference link 166
JS Cookie
referemce link 179
L
language code 315
language name 315
less secured applications, access enabling
reference link 44
Lightweight Directory Access Protocol (LDAP) 133
list view
AJAX pagination, adding 185, 186
list views
building 27
canonical URL, for models 30
creating, for user profiles 191, 192, 193, 194, 195
localization
about 314
adding 314
low-level cache API
M
managers
working with 22
many-to-many relationships
creating 153
creating, with intermediary model 188, 189, 190, 191
many-to-one relationships
reference link 52
markdown format
reference link 74
Memcached backend
adding, to project 436
download link 435
installing 435
monitoring 437
message file 315
messages framework
reference link 133
middleware
reference link 526
Middleware 97
migrate management command 6
migrations
creating, for model translations 342, 343
mixins
reference link 383
using, from django-braces 411
model API
reference link 22
model fields
model formsets
reference link 395
model inheritance
abstract model 367
multi-table model inheritance 368
proxy model 368
using 367
model managers
models
translating, with django-parler 338
multiple fields
searching 85
multiple subdomains
serving, with NGINX
multi-table model inheritance 367
N
NGINX binaries, for Windows
reference link 508
NGINX documentation
reference link 510
O
object-relational mapper (ORM) 22
online shop project
catalog templates, creating 233, 235, 236, 237
creating 226
functionalities 226
product catalog models, creating 227, 228, 229
product catalog models, registering on administration site 229
product catalog views, building 230, 231, 232
orders
exporting, to CSV files 285
P
pagination
working 35
parsers
reference link 447
path converters
reference link 29
payment authorization
reference link 284
Payment Card Industry (PCI) 270
payment gateway
Braintree, integrating with Hosted Fields 275, 276, 277, 278, 280, 281
Braintree Python module, installing 271, 272
Braintree sandbox account, creating 270, 271
integrating 269, 270, 272, 273, 275
payments
PDF files
sending, by email 298, 299, 300
PDF invoices
generating 293
PDFs, outputting with Django
reference link 293
PDF template
permissions
reference link 455
per-site cache
deactivating 471
using
pip installation
reference link 3
pip package
used, for installing Django 3, 4
Poedit
download link 323
post detail template
comments, adding 55, 56, 58, 59
PostgreSQL
download link 84
PostgreSQL full-text search
reference link 83
Postman
reference link 449
post() method 403
posts by similarity
retrieving 66
posts, via email
emails, sending with Django 43, 44, 45
forms, creating with Django 40, 41
forms, handling in views 41, 42
forms, rendering in templates 45, 46, 48, 49, 50
sharing 40
prefetch_related()
using 209
product catalog models
registering, on administration site 229
product catalog views
product detail page 349
product recommendation 349, 350, 351, 352, 353, 354, 356
project 10
proxy model 367
Python
Python 3.8.0
download link 2
Python code
code translation 320, 321, 322, 323, 325
lazy translation 319
plural forms translation 319, 320
standard translation 319
translating 318
variable translation 319
Python environment
creating 3
Python installer
download link 2
Python Social Auth
reference link 137
Q
QuerySet
about 22
evaluating 26
exclude(), using 25
filter() method, using 24
objects, deleting 25
objects, retrieving 24
objects, updating 24
order_by(), using 25
working with 22
QuerySets
optimizing 208
prefetch_related(), using 209
select_related(), using 208
R
RabbitMQ
installing 267
RabbitMQ, installing on macOS or Windows
reference link 267
ranking results 89
Real-time Django
with Channels 471
recommendation engine
building 349
Redis
about
download link 218
image ranking, storing 224
used, for storing item views 218
Redis commands
reference link 220
Redis, installing on Windows 10
reference link 219
redis-py documentation
reference link 220
Redis, scenarios
caching
counting
latest items, storing
pub/sub
queues
rankings and leaderboards
real-time tracking
regular expressions
reference link 30
renderers
reference link 447
Representational State Transfer (REST) 444
RequestContext
reference link 256
request cycle
request method
GET request 262
POST request 262
Requests, authentication
reference link
response cycle
REST API
REST framework
authentication backends 453
RESTful API
actions, adding to viewsets 457, 458
authentication, handling 453, 454
building 444
course contents, serializing 460, 462, 463
custom API views, building 452, 453
custom permissions, creating 458, 460
Django REST framework, installing 444, 445
list and detail views, building 447, 448, 449, 450
nested serializers, creating 450, 451, 452
serializers, defining 445, 446
views permissions, adding 454, 455
Rosetta's documentation
reference link 333
Rosetta translation interface
routers
reference link 457
S
save() method
overriding, of ModelForm 156, 157, 158, 159, 160
SearchVectorField field
reference link 86
search view
Secure Sockets Layer (SSL) 139, 516
select_related()
using 208
serializers
reference link 452
session data, options
cached database sessions 239
cached sessions 239
cookie-based sessions 239
database sessions 239
file-based sessions 239
settings, Django sessions
reference link 241
shopping cart
building 237
context processor, creating 254
Django sessions, expiration 241
Django sessions, settings 239
Django sessions, using 238
products quantities, updating 253
storing, in Django sessions 241, 242, 243, 246
template, building to display items and total 249, 251
shopping carts
views, creating 247
signals
application configuration classes 215, 216, 218
used, for denormalizing counts 211
Simple Mail Transfer Protocol (SMTP) 43
simple search lookups 85
sitemap framework
reference link 77
social authentication
development server, executing through HTTPS 138, 139, 140
Facebook, using 140, 141, 142, 143, 144, 145, 146
Google, using 148
reference link 137
social website project
creating 94
Spanish formatting configuration
reference link 346
SSL/TLS certificate
connections, securing with 516
Django project, configuring 519, 520
HTTP traffic, redirecting to HTTPS 520, 521
used, for configuring NGINX 517, 518, 519
stemming 89
student registration
adding 419
student registration view
subdomain middleware
creating 527
T
tagging functionality
template filters 32
template fragments
caching
templates
{% blocktrans %} template tag 325, 326
creating, for actions 209, 210, 211
creating, for views 31, 32, 33, 34
forms, rendering 45, 46, 48, 49, 50
shop templates, translating 326, 327, 328, 329
translating 325
{% trans %} template tag 325
template tags 32
template variables 32
Transport Layer Security (TLS) 43, 138, 516
trigram similarity
searching with 91
Twitter account
reference link 146
type of content
U
URL namespaces
reference link 30
URL patterns
for internationalization 334
language prefix, adding 334, 335
reference link 120
URL patterns, with regular expressions
reference link 30
URLs utility functions
reference link 31
user actions
adding, to activity stream 206, 207
user model
extending 124, 125, 126, 128, 129, 130
user profiles 120
detail views, creating 191, 192, 193, 194, 195
list views, creating 191, 192, 193, 194, 195
user registration 120, 121, 122, 123, 124
users
access, to switch language 336, 337
uWSGI options
reference link 508
uWSGI's documentation
reference link 504
V
views
adapting, for translations 343, 345, 346
caching
templates, creating 31, 32, 33, 34
viewsets
reference link 457
virtual environment (venv)
reference link 3
W
WeasyPrint
installing 293
reference link 293
Web Server Gateway Interface (WSGI) 5, 471
about 502
reference link 504
WebSocket client
implementing 478, 479, 480, 481, 482, 483, 484
weighting queries 90
Windows Subsystem for Linux (WSL) 219