A cookiecutter template to package Django Reusable Apps.
Creating reusable Django packages has always been annoying. There are no defined/maintained
best practices (especially for setup.py
), so you end up cutting and pasting hacky, poorly understood,
often legacy code from one project to the other. This template, inspired by cookiecutter-pypackage,
is designed to allow Django developers the ability to break free from cargo-cult configuration and follow
a common pattern dictated by the experts and maintained here.
- Poetry as package manager
- CircleCI as automated continuous integration pipeline
- Coverage.py as coverage measurement tool.
- Codecov as coverage reporter tool.
- Flake8 as Python code linter.
- Tox as automated Python multiversioning testing platform.
- Sphinx as documentation builder
- MIT licensed by default
These instructions will let you to build a fully documented, tested and integrated Django reusable app in seconds.
First install Cookiecutter:
pip install cookiecutter
Only one step is required to create a Django reusable app:
cookiecutter gh:AndreGuerra123/django-reusable-app
You'll be prompted for some questions, answer them, then it will create a directory that is your new package. Enter the created reusable app project and take a look around:
cd YOUR_PACKAGE_NAME/
ls
Django reusable app require the use of Poetry as the package manager.
pip install poetry
Then install your app development dependencies and create a virtualenv using:
poetry install
poetry shell
Create a GitHub repo and push it there:
git init
git add .
git commit -m "first awesome commit"
git remote add origin git@github.com:YOUR_GIT_USERNAME/YOUR_GIT_REPO.git
git push -u origin master
You're set up. It's time to write the code!!!
In order to lint using Flake8 your project in your local development environment, just run the following:
poetry run flake8 YOUR_PACKAGE_NAME
In order to automatically build your project documentation using Sphinx, just run the following command:
poetry run sphinx-apidoc -o /docs YOUR_APP_NAME
In order to test your project in your local development environment, just run the following:
poetry run tox
Deployment is perfomed automatically by CircleCI and Poetry, if all tests are passed. Your order to do so, your Pypi credentials must be added to CircleCI environment.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
We use SemVer for versioning.
For the versions available, see the tags on this repository.
For the modifications made in each version, read the CHANGELOG.md.
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details
Please refer to ROADMAP.md for future features to be developed.