The Django web framework includes a default object-relational mapping layer (ORM) that can be used to interact with application data from various relational databases such as SQLite, PostgreSQL and MySQL.
The Django ORM has evolved over the past dozen years since it was created make sure to not only read up on the latest tutorials but also learn about newer optimizations, such as prefetch_related and select_related, that have been added throughout the project's history.
Django models, encapsulation and data integrity is a detailed article by Tom Christie on encapsulating Django models for data integrity.
Django Debug Toolbar is a powerful Django ORM database query inspection tool. Highly recommended during development to ensure you're writing reasonable query code. Django Silk is another inspection tool and has capabilities to do more than just SQL inspection.
Making a specific Django app faster is a Django performance blog post with some tips on measuring performance and optimizing based on the measured results.
Why I Hate the Django ORM is Alex Gaynor's overview of the bad designs decisions, some of which he made, while building the Django ORM.
Going Beyond Django ORM with Postgres is specific to using PostgreSQL with Django.
Migrating a Django app from MySQL to PostgreSQL is a quick look at how to move from MySQL to PostgreSQL. However, my guess is that any Django app that's been running for awhile on one relational database will require a lot more work to port over to another backend even with the power of the ORM.
Django Model Descriptors discusses and shows how to incorporate business logic into Django models to reduce complexity from the views and make the code easier to reuse across separate views.
Adding basic search to your Django site shows how to write generic queries that'll allow you to provide site search via the Django ORM without relying on another tool like ElasticSearch. This is great for small sites before you scale them up with a more robust search engine.
The Django ORM Cookbook provides code recipes for various ways to use the Django ORM to insert and query data.
How to use Django's Proxy Models is a solid post on a Django ORM concept that doesn't frequently get a lot of love or explanation.
Tightening Django Admin Logins shows you how to log authentication failures, create an IP addresses white list and combine fail2ban with the authentication failures list.
Sorting querysets with NULLs in Django shows what to do if you're struggling with the common issue of sorting columns that contain NULL values.
Best Practices working with Django models in Python
has a ton of great advice on proper model naming conventions, quirks to
ForeignKey field relationships, handling IDs and many other
edge cases that come up when frequently working with Django's ORM.
Working with huge data sets in Django
explains how to slice the data you retrieve by query into pages and then
prefetch_related on a subset of the data rather than your whole
Solving performance problems in the Django ORM
gives a slew of great code snippets to use with
you can discover issues such as unexpected extra queries and problematic
Django migrations were added in version 1.7. Django projects prior to 1.7 used the South project, which is now deprecated and merged into Django. Migrations can be tricky to wrap your head around as you're getting started with the overall framework but the following resources should get you past the initial hurdles.
Django Migrations - a Primer takes you through the new migrations system integrated in the Django core as of Django 1.7, looking specifically at a solid workflow that you can use for creating and applying migrations.
Django 1.7: Database Migrations Done Right explains why South was not directly integrated into Django, how migrations are built and shows how backwards migrations work.
Squashing and optimizing migrations in Django shows a simple example with code for how to use the migrations integrated into Django 1.7.
Supporting both Django 1.7 and South explains the difficulty of supporting Django 1.7 and maintaining South migrations for Django 1.6 then goes into how it can be done.
Writing unit tests for Django migrations contains a ton of awesome code examples for testing your migrations to ensure data migrations work well throughout the lifecycle of your Django project.
Secure and manage identities in your Python web apps with Okta.
Easily build maps, search and navigation into your Python applications with Mapbox.
Scout monitors the performance of your Python apps, identifying slow queries, memory bloat, and more. Free during Tech Preview.