0911 Learning Django
0911 Learning Django
#django
Table of Contents
About 1
Remarks 2
Versions 2
Examples 3
Starting a Project 3
Django Concepts 5
Virtual Environment 7
Python 3.3+ 7
Python 2 7
Project Structure 10
Dockerfile 11
Compose 11
Nginx 12
Usage 12
Chapter 2: Administration 14
Examples 14
Change list 14
views.py 17
urls.py 17
forms.py 17
admin.py 18
Syntax 19
Remarks 19
Examples 19
A basic ArrayField 19
Nesting ArrayFields 20
Querying for all models who contain any item in a list with contained_by 20
Remarks 21
Examples 21
Examples 23
Remarks 24
Examples 24
views.py 24
urls.py 24
Context data 24
views.py 25
book.html 25
app/models.py 25
app/views.py 25
app/templates/app/pokemon_list.html 26
app/templates/app/pokemon_detail.html 26
app/urls.py 26
app/views.py 27
app/templates/app/pokemon_form.html (extract) 27
app/templates/app/pokemon_confirm_delete.html (extract) 28
app/models.py 28
Minimal example 29
Remarks 32
Examples 32
Using a context processor to access your most recent blog entries in all templates 32
Examples 35
Examples 37
Examples 42
Examples 45
Examples 47
MySQL / MariaDB 47
PostgreSQL 48
sqlite 49
Fixtures 49
Examples 52
Atomic transactions 52
Problem 52
Solution 52
Remarks 54
Examples 54
Consider Writing More Documentation, Tests, Logging and Assertions Instead of Using a Debu 57
Examples 58
NGINX 61
GUNICORN 62
SUPERVISOR 62