https://github.com/stuartmackay/django-app-template
The template I use to create reusable Django apps.
https://github.com/stuartmackay/django-app-template
app django pypi-package template
Last synced: 7 days ago
JSON representation
The template I use to create reusable Django apps.
- Host: GitHub
- URL: https://github.com/stuartmackay/django-app-template
- Owner: StuartMacKay
- License: apache-2.0
- Created: 2023-03-04T08:22:48.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-12-23T04:11:13.000Z (over 2 years ago)
- Last Synced: 2025-02-27T08:17:17.911Z (over 1 year ago)
- Topics: app, django, pypi-package, template
- Language: Makefile
- Homepage:
- Size: 137 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.rst
- Contributing: CONTRIBUTING.rst
- License: LICENSE.txt
Awesome Lists containing this project
README
===================
Django App Template
===================
Half the battle to create a successful project is getting everything
organized. This is a Github template repository for a reusable Django
app that can be released on PyPi.
Features
--------
* Development with `black `_ so everybody gets the code formatting rules they deserve
* Development with `flake8 `_ so people using ed get syntax checking
* Development with `isort `_ for automatically sorting imports
* Development with `mypy `_ for type-hinting to catch errors
* Testing with `pytest `_ and `FactoryBoy: `_
* Manage versions with `bump-my-version `_ - for semantic or calendar version numbers
* Manage dependencies with `pip-tools `_
Quick start
-----------
This is a GitHub template repository. Simply create a new repository from it
or open it in a Code Space. The repository will contain a single commit.
After you checkout your repository, the first step is to rename the app:
.. code-block:: shell
./bin/rename-app myapp
Next, build the virtualenv and install all the dependencies. This will also
build the library containing the app:
.. code-block:: shell
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip setuptools wheel
pip install pip-tools
Optional. The project is shipped with pinned versions for the dependencies.
If you want to upgrade to the latest versions then recompile the requirements
source files:
.. code-block:: shell
pip-compile --upgrade requirements/dev.in
pip-compile --upgrade requirements/docs.in
pip-compile --upgrade requirements/tests.in
Install the dependencies:
.. code-block:: shell
pip-sync requirements/dev.txt
Run the tests:
.. code-block:: shell
pytest
Run the django server:
.. code-block:: shell
./manage.py runserver
Open a browser and visit http://localhost:8000 and, voila, we have a working
site. Well cover the deployment later.