We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
The Django Jigsaw Puzzle: Aligning All the Pieces with Will Vincent - DjangoCon US 2022
"Aligning Django's puzzle pieces: learn how to effectively build with the framework's components, from views to templates, middleware to internationalization, at DjangoCon US 2022."
-
avoid using
pythonmanage.py
in favor of thesettings
module - learn Django iteratively, don’t try to understand everything at once
- the Django framework is built of smaller pieces, like a jigsaw puzzle
-
the request-response cycle is the core of Django
-
it starts with
views.py
, which handles HTTP requests - uses models to interact with databases
- uses templates to render HTML
- uses URL routing to match URLs to views
-
it starts with
- middleware is a hook into the request-response cycle
- the Django admin is a powerful tool, but can be overwhelming
-
testing is crucial; use
pytest
instead of the default Django testing - templates are easy to customize; use Jinja or React if needed
-
static files can be tricky; use
whizgee
to optimize and serve statically generated files -
avoid using
startapp
andstartproject
commands; instead, create a new project and app levels -
internationalization and localization are powerful features; use
ugettext
andformat
functions to translate -
the order of operations in the request-response cycle is:
client
->web server
->whizgee server
->Django app