Packaging Django projects for PyPI
summary
Shows how to make a Django project pip-installable by turning the project into a Python package: namespace apps into a module and convert settings into a namespace settings module with a base + local pattern. Adds an initial_setup command that auto-generates a compliant secret key, creates a local settings file, runs migrations and creates a random-admin account (with a nag until password change). Extracts secret-key logic into a reusable util (ticket 45-28) and publishes django-auto-admin; demo installs and runs with ~98% functionality after two commands.
AI-written summary · about
chapters (21)
- 0:00Introduction and motivation
- 2:25Django project packaging challenges
- 4:54Flat project structure issues
- 6:00Settings file orchestration problems
- 7:03Namespace settings solution
- 9:12Secret key generation pitfalls
- 11:21Simplifying installation steps
- 13:30Avoiding secret key commits
- 14:57Local settings fallback logic
- 17:08Database migration automation
- 19:20Admin user security risks
- 20:47Random password generation
- 21:51Password change enforcement
- 22:38Deployment directory handling
- 24:49Media file publishing prevention
- 25:55Management command shortcuts
- 27:20Onboarding help messages
- 28:46Path length and virtualenv issues
- 29:29Start project command alternative
- 30:39One-command installation demo
- 33:28Q&A on secret key storage
