An openlayers widget for Django with extended capabilities | Read-only mirror of https://github.com/sitn/django-extended-ol — Canton de Neuchâtel. Issues & pull requests at the source.
  • Python 73.7%
  • JavaScript 13.5%
  • HTML 10.4%
  • CSS 2.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-06-22 16:00:25 +02:00
demo fix demo redirect and update dotnetid 2026-06-04 17:33:45 +02:00
django-dotnetid do not flush is_staff permission on login 2026-06-22 16:00:25 +02:00
django-extended-ol new 1.2.2 2026-01-19 17:05:34 +01:00
sitn fix demo redirect and update dotnetid 2026-06-04 17:33:45 +02:00
.env.sample support agov, openid working 2025-12-18 14:50:53 +01:00
.gitignore fix demo redirect and update dotnetid 2026-06-04 17:33:45 +02:00
manage.py init demo app 2025-04-24 15:07:02 +02:00
pyproject.toml fix demo redirect and update dotnetid 2026-06-04 17:33:45 +02:00
README.md get all attributes and set username for agov 2026-05-19 14:44:32 +02:00

sitn-django-plugins

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

Requirements

  • Postgis
  • poetry (pip install poetry)
  • poetry Shell plugin (poetry self add poetry-plugin-shell)
  • Poetry Dotenv Plugin (poetry self add poetry-dotenv-plugin)

Getting started

  1. Create a local postgis database
CREATE DATABASE sitn;
CREATE EXTENSION postgis;
CREATE SCHEMA sitn;
  1. Fill your .env accordingly. A .env.sample is provided to help you.

  2. Install you app and activate venv:

poetry install
poetry shell
  1. Migrate and run your app
python manage.py migrate
python manage.py runserver

Start developing

The 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 runserver

With 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

Build and publish

⚠️ You need a pypi.org account and a personal access token in order to publish.

  1. Don't forget to:
  • update README.md of your package
  • increment the version number in the pyproject.toml
  • update CHANGELOG.md
  1. Build your package, for example for django-extended-ol:

If necessary, delete old built versions in dist folder.

cd django-extended-ol
python -m build
  1. Publish it to pypi.org
python -m twine upload dist/*