This repository has two goals:
- demo how to use a sitn django plugins within this a basic Django app
- provide a sandbox to develop new custom plugins
- Postgis
- poetry (pip install poetry)
- poetry Shell plugin (poetry self add poetry-plugin-shell)
- Poetry Dotenv Plugin (poetry self add poetry-dotenv-plugin)
- Create a local postgis database
CREATE DATABASE sitn;
CREATE EXTENSION postgis;
CREATE SCHEMA sitn;-
Fill your
.envaccordingly. A.env.sampleis provided to help you. -
Install you app and activate venv:
poetry install
poetry shell- Migrate and run your app
python manage.py migrate
python manage.py runserverThe django app is now running the plugins installed from pypi.org. If you want it to run directly from the sub-directory, it is possible. This way you don't have to compile your package and install it to test your dev.
Let's say you want to start developing a new feature on django-extended-ol. Run this in your poetry shell activated:
poetry remove django-extended-ol
cd django-extended-ol
python -m pip install --editable .
cd ..
python manage.py runserverWith python -m pip install --editable . we install a live-reloaded version of the plugin that we will need to uninstall later.
At the end of the development, don't forget to revert back:
cd django-extended-ol
python -m pip uninstall django-extended-ol
cd ..
poetry add django-extended-ol-
Don't forget to update README.md of your package and increment the version number in the pyproject.toml.
-
Build your package, for example for
django-extended-ol:
cd django-extended-ol
python -m buildIf necessary, delete old built versions in dist folder.
- Publish it to pypi.org
python -m twine upload dist/*