Skip to content

A copier template for generating a Django app. Python 3.9-3.12 and Django 4.x-5.x compatible, pre-commit, test matrix + coverage, Github actions for CI, publish to Pypi & create release, github issues config + templates, docs with MkDocs + Material, and more!

License

Notifications You must be signed in to change notification settings

matagus/django-app-starter

Repository files navigation

django-app-starter

Demo.gif

Python Compatibility License We use Hatch linting - Ruff code style - black

Generate a new Django app with all the goodies you need to start developing, testing and publishing your app to PyPI and Github.

Features

  • 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.

Coming Soon

Usage

Prerequisites

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.

Contributing

Contributions are welcome! ❤️

License

django-app-starter is released under an MIT License - see the LICENSE file for more information.

Webliography

About

A copier template for generating a Django app. Python 3.9-3.12 and Django 4.x-5.x compatible, pre-commit, test matrix + coverage, Github actions for CI, publish to Pypi & create release, github issues config + templates, docs with MkDocs + Material, and more!

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks