django-gisserver
Django speaking WFS 2.0 to expose geo data.
Features
- WFS 2.0 Basic implementation.
- GML 3.2 output.
- Standard and spatial filtering (FES 2.0)
- GeoJSON and CSV export formats.
- Extensible view/operations.
- Uses GeoDjango queries for filtering.
- Streaming responses for large datasets.
Documentation
For more details, see: https://django-gisserver.readthedocs.io/
Test drive
- Run
docker compose up. - Open http://localhost:8000/ to see this works.
- Connect to http://localhost:8000/wfs/ in your GIS client (e.g. QGis) and zoom to Amsterdam.
- Add more data on the map using the Django admin, username and password are both "admin".
Quickstart
Install the module in your project:
pip install django-gisserver
Add it to the INSTALLED_APPS:
INSTALLED_APPS = [
...
"gisserver",
]
Create a model that exposes a GeoDjango field:
from django.contrib.gis.db.models import PointField
from django.db import models
class Restaurant(models.Model):
name = models.CharField(max_length=200)
location = PointField(null=True)
def __str__(self):
return self.name
Write a view that exposes this model as a WFS feature:
from gisserver.crs import CRS, CRS84, WEB_MERCATOR
from gisserver.features import FeatureType, ServiceDescription
from gisserver.views import WFSView
from .models import Restaurant
# As example, the local coordinate system for The Netherlands
RD_NEW = CRS.from_string("urn:ogc:def:crs:EPSG::28992")
class PlacesWFSView(WFSView):
"""An simple view that uses the WFSView against our test model."""
xml_namespace = "http://example.org/gisserver"
# The service metadata
service_description = ServiceDescription(
title="Places",
abstract="Unittesting",
keywords=["django-gisserver"],
provider_name="Django",
provider_site="https://www.example.com/",
contact_person="django-gisserver",
)
# Each Django model is listed here as a feature.
feature_types = [
FeatureType(
Restaurant.objects.all(),
fields="__all__",
other_crs=[RD_NEW, CRS84, WEB_MERCATOR]
),
]
Use that view in the URLConf:
from django.urls import path
from . import views
urlpatterns = [
path("/wfs/places/", views.PlacesWFSView.as_view()),
]
You can now use http://localhost:8000/wfs/places/ in your GIS application. It will perform requests such as:
- http://localhost:8000/wfs/places/?SERVICE=WFS&REQUEST=GetCapabilities&ACCEPTVERSIONS=2.0.0,1.1.0,1.0.0
- http://localhost:8000/wfs/places/?SERVICE=WFS&REQUEST=DescribeFeatureType&VERSION=2.0.0&TYPENAMES=restaurant
- http://localhost:8000/wfs/places/?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=restaurant&STARTINDEX=0&COUNT=1000&SRSNAME=urn:ogc:def:crs:EPSG::28992
By adding &OUTPUTFORMAT=geojson or &OUTPUTFORMAT=csv to the GetFeature request, the GeoJSON and CSV outputs are returned.
The CSV output has an unlimited page size, as it's quite performant.
Why this code is shared
The "datapunt" team of the Municipality of Amsterdam develops software for the municipality. Much of this software is then published as Open Source so that other municipalities, organizations and citizens can use the software as a basis and inspiration to develop similar software themselves. The Municipality of Amsterdam considers it important that software developed with public money is also publicly available.
This package is initially developed by the City of Amsterdam, but the tools and concepts created in this project can be used in any city.
Metadata
Release files for django-gisserver 2.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django_gisserver-2.5.0.tar.gz | 185.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_gisserver-2.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 392.1 kB
Release files / django_gisserver-2.5.0.tar.gz
| Download URL | django_gisserver-2.5.0.tar.gz |
|---|---|
| Size | 185.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e3f42fc28e105fa673b8750eca96ec18b76251d8596e61359bb405b3a9bbe2e5
|
|
BLAKE2b-256 checksum How to use checksums |
9887429e3bb4eb651f6757ea113aedcef359d6c9dbc3d89d6a1ed09469af8b3e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.
Transparency logRelease files / django_gisserver-2.5.0-py3-none-any.whl
| Download URL | django_gisserver-2.5.0-py3-none-any.whl |
|---|---|
| Size | 206.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
694131b66014138bef3526e7573ecd5c14fffc7525fe607f222c5b931db2b731
|
|
BLAKE2b-256 checksum How to use checksums |
bbc2346eed212711d5604be1941f0ac003abef85ab201e262ceab0e7da1f9017
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.
Transparency log