DjangoCon 2021 WorkShop | Suggestions for common challenges in your projects | Johannes Spielmann
In this workshop, we are going to look at four challenges that appear in every Django project at some point. We are going to analyze what's happening, what you can do to get un-stuck, and see what other people do.
This workshop is for beginners and advanced Django users. The issues we discuss appear in many Django projects, so there is something here for every level of Django knowledge.
These are the four challenges we are going to look at:
- App management and placement (and urlpatterns)
- Templates: Placement, folders, blocks and inheritance and namespaces
- When to use Middlewares and context processors and what are they?
- Should code/logic go into models, views or managers or somewhere else?
For each of these, we will try out what I do when they happen, and we'll discuss other strategies.
We will not do a lot of coding in this workshop, but if you want to follow along, make sure you have Django installed and can execute "django-admin.py". There is also a set of base templates I am going to use for illustration, which is linked in the files below.
Of course, there are many more problems like these, which is why I made a list of "suggestions" or "best practices" for these and others. Here's what we're working on so far:
- App management and placement (and urlpatterns)
- Splitting settings: local, dev, testing and production
- Username vs email address
- Registration in general
- Background tasks and long-running processes and Caching
- Templates: Placement, folders, blocks and inheritance and namespaces
- Should you do i18n and l10n right away?
- When and how to start caching (memcached, redis etc.)
- Should code/logic go into models, views or managers or somewhere else?
- When to use Middlewares and context processors and what are they?
- How to secure access: security middlewares or login_required (white vs black list)
- How to create files and store them in file models
- What to do about image scaling and thumbnailing (and hosting)?
- How to serve content: coded pages, flatpages or Wagtail?
You can find that list on Github at: https://github.com/shezi/django-unstuck (it's a work-in-progress). There is also a Discord community and Telegram chat group surrounding that list, so if you have any kind of problem with a Django project, come join us and we'll find a way to get you unstuck.
We're building a community around Django best practices and on getting you Unstuck in challenging situations. Join us on Discord at https://discord.gg/bUsu9B6Ek6 or on Telegram at https://t.me/djangoRhein
About me: I'm Johannes Spielmann, software developer-for-hire from Germany, and I've been doing Django projects for almost 15 years, ever since I saw Adrian Holovaty's presentation at "Snakes and Rubies". I've done projects both small and large, both in commercial and non-commercial settings, and I've seen all of the above things many times.
Date Added: September 19, 2024
Note: We understand that names change, people change, and bodies change. We respect each individual's journey and privacy. If you have any concerns about a video or need us to remove content, please don't hesitate to contact us. We will handle your request with care and promptly address any issues.