Thanks for the ping / shout out! This is something I’ve been trying to figure out as well and am very interested to hear best practices from others. My general sense is that everyone is figuring out this stuff and just throwing a bunch of things at the wall and seeing what sticks. Or at least that’s what I’m doing. 
A general “Django rules” file would be awesome, but I didn’t find anything great in my research and a lot of stuff I did find was like “be a super duper smart senior developer” which… I’m skeptical helps? Plus every Django project will have its own set up and guidelines so I don’t know how generally useful rules can be across projects.
Some specific things I’ve found useful:
A big picture “architecture” section/file. This is somewhat useful when building out end to end features. Here’s what mine looks like:
## Architecture
- This is a Django project built on Python 3.12.
- User authentication uses `django-allauth`.
- The front end is mostly standard Django views and templates.
- HTMX and Alpine.js are used to provide single-page-app user experience with Django templates.
HTMX is used for interactions which require accessing the backend, and Alpine.js is used for
browser-only interactions.
- JavaScript files are kept in the `/assets/` folder and built by vite.
JavaScript code is typically loaded via the static files framework inside Django templates using `django-vite`.
- APIs use Django Rest Framework, and JavaScript code that interacts with APIs uses an
auto-generated OpenAPI-schema-baesd client.
- The front end uses Tailwind (Version 4) and DaisyUI.
- The main database is Postgres.
- Celery is used for background jobs and scheduled tasks.
- Redis is used as the default cache, and the message broker for Celery.
I also have a dedicated “commands” section/file. This is especially helpful for things like uv where the agents often try to use pip and virtualenv by default. So stuff like this:
- Adding python dependencies: `uv add <library>`
- You can run generic Python commands using `uv run <command>`
I also find giving it best practices around my project’s data modeling has been helpful when it’s generating new models. E.g.
- All Django models should extend `apps.utils.models.BaseModel` (which adds `created_at` and `updated_at` fields).
- The project's user model is `apps.users.models.CustomUser` and should be imported directly.
Obviously telling it your preferences on, e.g. CBVs vs FBVs, whether you use DRF or ninja and that sort of thing is useful.
Big picture, I think the most useful practice has been whenever it does something differently than I wanted, make a rule that tells it how to do it the right way and then tell it to read the rule and do it again. This has been a nice way to iterate on my rules and generally have it continually adapt more and more to my project’s specific setup.