Skip to main content

codecov CI

Django Mapbox Baselayer

Django application to store, manage and serve map base layers and overlay configurations for MapLibre GL JS and Mapbox GL JS.

This package provides:

  • Django models to store base layers and overlay layers configuration
  • Admin interface to manage layers
  • API endpoints to serve layer configurations as TileJSON
  • Support for raster tiles, vector tiles, and Mapbox styles

Map Example

Getting started

Installation

Install it in your project like any dependency

pip install django-mapbox-baselayer

Usage

Declare django-mapbox-baselayer in the INSTALLED_APPS

# settings.py

INSTALLED_APPS  = [
    # ... other django apps
    "mapbox_baselayer",
]

For Mapbox base layers, you do not need to describe the tiles with the BaseLayerTile object, but an url is mandatory.

For Raster base layers, is it necessary to create a BaseLayerTile for each url (a.tiles.xxx, b.tiles.xxx, etc ...)

Tile size should be 256 for raster and 512 for vector.

Commands

Unified install_layer command

# OSM base layer
./manage.py install_layer osm
./manage.py install_layer osm --order 2

# OpenTopoMap base layer
./manage.py install_layer opentopomap
./manage.py install_layer opentopomap --order 3

# IGN base layers (list available layers)
./manage.py install_layer ign

# IGN base layers (install specific layers)
./manage.py install_layer ign ortho plan maps scan_25 cadastre plan_vt
./manage.py install_layer ign maps scan_25 --key my_api_key --order=1
./manage.py install_layer ign cadastre --overlay
./manage.py install_layer ign ortho --attribution "© IGN - Custom"

CHANGELOG

1.5.3 (2026-11-26)

Improvements

  • Handling bad response in tile download
  • Test app now use maplibre-gl@^6 instead of maplibre-gl@latest to avoid breaking changes in the future.
  • Fix referrer policy to avoid OSM tiles 403 error when using maplibre-gl@^6
  • Add --attribution option to install_layer ign command (defaulting to © IGN)
  • Serve style URL layers through the local TileJSON endpoint to apply attribution overrides and caching

Bugfixes

  • Include real_url in style cache key to avoid stale cache when style URL changes
  • Only fill missing source attribution in style TileJSON when layer attribution is set

1.5.2 (2026-07-16)

Improvements

  • User absolute url in API responses

1.5.1 (2026-07-10)

Improvements

  • Add bbox option to PMtiles generator
  • Add id in layer API responses

1.5.0 (2026-07-08)

Improvements

  • Admin styles improvements
  • No vector generic type anymore

Bugfixes

  • Default zoom levels for IGN layers

1.4.1 (2026-07-07)

Improvements

  • Change pmtiles maxbounds format

1.4.0 (2026-07-07)

New features

  • Generate and store and serve PMtiles from layers definition.

1.3.0 (2026-07-06)

New features

  • add default embedded font glyphs and use it instead of mapbox glyphs

Improvements

  • Replace map_box_url by style_url
  • Override attribution if provided in config
  • Cache styles url

1.2.2 (2026-03-18)

Bugfixes

  • Fix update via admin

1.2.1 (2026-02-13)

Improvements

  • Provide function to get layer list without url fetch.

1.2.0 (2026-02-10)

Improvements

  • Provide default OSM base layer if no layer in database.
  • Change default glyph by demo glyph to avoid map style problems on raster based layer.
  • Commands are replaced by ìnstall_layer command with different options to install different layers.
  • Use proxy models in admin for Base layers / Overlays / Style URL / Raster.
  • Customize forms for Raster or Style URL layers
  • Ability to enable / disable layers in admin without deleting them.

1.1.1 (2026-02-07)

Improvements

  • mapbox url is now labeled as "Style URL".
  • IGN Plan Vector tile layer is available

Bugfixes

  • IGN layers are updated to use the new style url instead of the old tile url.

Development

  • Use ruff instead of flake / black / isort

1.1.0 (2026-02-06)

New features

  • Add overlays concept to allow adding layers on top of baselayers. This is useful for example to add a layer with markers on top of a baselayer.
  • Add JSON endpoint to get baselayer data. This is useful for example to get the real url of a mapbox style.

Improvements

  • Add example view

Maintenance

  • Drop official support for python <= 3.9
  • Add official support for python 3.13
  • Add official support for python 5.2 and 6.0

1.0.0 (2023-07-11)

  • Increase attribution size to 1024 chars.
  • Support django 4.2, drop django 2.2
  • Support python 3.11

0.0.9 (2022-11-09)

  • Improve install_ign_baselayer command. Add Plan IGN V2 and fix multi layer import.
  • Support django 3.2, 4.0 and 4.1
  • Support python 3.10

0.0.8 (2020-11-03)

  • Add command to create Mapbox layer
  • Add command to create different IGN layers

0.0.7 (2020-10-30)

  • Admin is now registered by default. Delete enabling code in your project.
  • Set default mapbox glyphs to avoid map style problems on raster based layer
  • Add commands to create OSM and OpenTopoMap base layers

0.0.6 (2020-09-09)

  • Support django 3.1

0.0.5 (2020-06-03)

  • Fix translations

0.0.4 (2019-12-04)

  • Allow using map_box_url to store vector external json

0.0.3 (2019-12-03)

  • add tile Size option for raster layers
  • add attribution option for all layers
  • Add real_url property to model MapBaseLayer, to get real url for mapbox styles
  • fix MapBaseLayer deletion
  • Enable fr translation

0.0.2 (2019-11-29)

  • Increase tile url max size

0.0.1 (2019-11-25)

  • First release

Metadata

Release files for django-mapbox-baselayer 1.5.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-mapbox-baselayer 1.5.3
File Size Uploaded Provenance Actions
django_mapbox_baselayer-1.5.3.tar.gz 70.2 MB With provenance Details for django_mapbox_baselayer-1.5.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-mapbox-baselayer 1.5.3
File Interpreter ABI Platform Actions
django_mapbox_baselayer-1.5.3-py3-none-any.whl Python 3 none any Details for django_mapbox_baselayer-1.5.3-py3-none-any.whl

Total release size: 144.6 MB

Release files / django_mapbox_baselayer-1.5.3.tar.gz

Download URL django_mapbox_baselayer-1.5.3.tar.gz
Size 70.2 MB
Tags Source
SHA-256 checksum
How to use checksums
dc1a17253fbe75cda1c94b035178f0313e3506c8175f6cbb919de1d59ed6ab3a
BLAKE2b-256 checksum
How to use checksums
330b7678718abc96056c6f8b02d5d63ac4a7a6f955dc42b2eabefef3935a7a93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 26, 2026.

Transparency log

Release files / django_mapbox_baselayer-1.5.3-py3-none-any.whl

Download URL django_mapbox_baselayer-1.5.3-py3-none-any.whl
Size 74.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
f5b04c3d86f6c1d29d325e1c5e501e7641737e0b46180e7732a8e733a4bb67ff
BLAKE2b-256 checksum
How to use checksums
e895cfad7ad2cfb8fe45b518f12a66a43ffe3f7990a69f0449af47f353a8304d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 26, 2026.

Transparency log

Security for django-mapbox-baselayer 1.5.3

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for django_mapbox_baselayer-1.5.3.tar.gz

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 Nov 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page