Generate a new Django app with all the goodies you need to start developing, testing and publishing your app to PyPI and Github.
- Compatibility with Python 3.9 to 3.12 and Django 4 to 5.0.3.
- Package management and dynamic versioning using Hatch.
- Testing with
hatch
for all possible combinations of Python and Django versions. - Code coverage reporting to using Coverage.py.
- Ready to use GitHub Actions
pipelines for:
- CI + reporting code coverage to codecov.io
- Building and publishing to Pypi when a new tag is pushed
- Creating a draft release
-
pre-commit
configuration with:-
black
for code formatting - Linting and formatting with
ruff
-
codespell
,pyupgrade
and several standard checks.
-
- Consistent coding styles for multiple editors and IDEs via .editorconfig file.
- Configuration using
pyproject.toml
file. -
README.md
file with instructions on how to start developing, testing and publishing your app. - An
example_project
fully configured to try you app from the start. - Dependency updates with Dependabot.
- Issues templates for bugs and features, a Code of conduct file referencing Django's CoC, and a Security Policy config.
- Sync updates from newest versions of this template with Copier.
- Standardised list of GitHub labels synchronised on push to main branch using the labels CLI.
- Documentation with Material for MkDocs and docstring reference support with mkdocstrings.
- Latest stable documentation published to GitHub/GitLab Pages.
- Versioned documentation and pull request previews with Read the Docs.
- Containerization for development and deployment with dev container.
- Follow the all-contributors specification.
- Turn Github repository in to a Template Repository that does all the setup so people don't need to install copier and run it locally. Similar to what Simon Willison did with his cookicutter template
You need to have copier
and hatch
installed in your system. If you don't have them, you can install them with:
pip install copier
pip install hatch
Then generating a new Django app is as simple as running:
copier copy https://github.com/matagus/django-app-starter <app-name>
You will be prompted to enter some data needed to generate your app, and then you will have a new directory with your app ready to go.
django-app-starter
comes wwith an example project you can use to test your app. To run it just do:
cd <app-name>
hatch run project:migrate
hatch run project:createsuperuser
hatch run project:runserver
Also, you can run the tests (for all the Python + Django valid combinations) with:
hatch run test:test
And you can check the coverage with:
hatch run test:cov
To run tests for a specific Python and Django version, for instance Python 3.12 and Django 5.0, you can use:
hatch run test.py3.12-5.0:test
Learn more about hatch
and its commands in the official documentation or
just ask for help in our Discussion section.
Contributions are welcome! ❤️
django-app-starter
is released under an MIT License - see the LICENSE
file for more information.