
Go from a new environment to starting a Django project before your coffee cools!
I put all my Django best practices into this starter repository so you can start building right away.
This will help you:
git clone https://github.com/victoriadrake/django-starter./env-setup.sh(It's always a good idea to read scripts before running them! If you don't, well, thanks for the Bitcoin.)
Do make install to install dependencies in a virtual environment.
If you'd like help installing just Django via Pipenv, run ./django-setup.sh.
You can now do make dev to see a pretty welcome page at http://localhost:8000/ and test that everything's working properly.
Start building! If you're new to Django, check out their great tutorials.
Run make help to see what else I've got set up for you.
Over the years I've been developing with Django, I've built up a suite of developer tools, practices that help make programmers more efficient, and lots of little tips and ideas that make building with Django easier.
I've written about a lot of these, and wanted to make it easier for you to use them too!
You can take advantage of automation to relieve developers of having to remember to run linting, tests, and other routine actions. The use of pre-commit and flows like GitHub Actions can help to keep your codebase consistent, tested, and easier to develop.
Instead of the default settings.py, I use a settings directory with separate files for local and production environment settings. This helps avoid misconfiguration mishaps!
You can pass the settings file as an argument, for example when running the development server:
python manage.py runserver --settings=app.settings.localThe Makefile command make dev uses this. Speaking of...
Imagine having a super helpful, project-specific CLI that neatly remembers all your typical development actions for you. For example, instead of typing...
pipenv run coverage run python manage.py test app --verbosity=0 --parallel --failfastYou can just do:
make testIsn't that better? I think so! Check out the self-documenting Makefile to see how it makes other everyday actions easier. (Why's it self-documenting? Just type make help and see.)
Have something to add? Feel free to open a pull request!