django-leaflet
A Django map widget using Leaflet
What it is and what it does
django-leaflet packages the Leaflet JavaScript mapping library (version 1.9.3) as a reusable Django app, eliminating the need to embed map assets in every project. It provides form widgets for geometry editing, template tags for rendering maps, and centralized control over map appearance and behavior through Django settings.
The package is designed for developers building location-aware Django applications who want interactive client-side maps without managing Leaflet dependencies manually. It supports geometry edition through form widgets and integrates with geographic data workflows, though spatial database support is optional—you can handle geographic data without PostGIS or similar if needed.
Use it for:
- Add interactive map widgets to Django admin or custom forms for location selection and geometry editing.
- Display geographic data on web pages using Leaflet maps configured entirely from Django settings.
- Build location-based applications (e.g., store locators, event maps) without duplicating Leaflet setup across projects.
- Manage map appearance and behavior (tiles, zoom, center) at deployment time via Django configuration.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Integrates the Leaflet JavaScript mapping library into Django projects, providing map widgets for forms and template rendering with server-side configuration.
Yes, if you need Leaflet maps in a Django project. Low install friction, stable production status, and active repository support make it a sound choice. The LGPL-3.0-only license is a consideration for proprietary work but poses no barrier for open-source projects. No known vulnerabilities. Maintenance pace is slower than recent, but the package is mature and the underlying Leaflet library is widely used.
Install
django-leaflet on PyPI
pip
pip install django-leafletuv
uv add django-leafletpoetry
poetry add django-leafletInstalling django-leaflet
Before you install
Low friction install with a single runtime dependency on django. Last release was 256 days ago; repository is active and not archived, though maintenance pace appears to have slowed.
License in practice
Licensed under LGPL-3.0-only (copyleft). You must disclose source code modifications and distribute derivative works under the same license; suitable for open-source projects but requires careful review for proprietary applications.
Quickstart
pip install django-leaflet
# In Django settings.py
INSTALLED_APPS = ['leaflet', ...]
# In a template
{% load leaflet_tags %}
{% leaflet_js %}
{% leaflet_css %}
Requires Python 3.10 or later and Django as a runtime dependency.
Verify before relying
- Whether the embedded Leaflet version 1.9.3 receives security updates independently or requires django-leaflet releases
- Compatibility with django-geojson and whether that integration requires additional setup beyond what the package provides
Package facts
| License | LGPL-3.0-only (copyleft) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — django |
| Maintenance | aging — 256 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 111,170/month — #12,429 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: django_leaflet-0.33.0-py3-none-any.whl
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
django-map-widgetsProvides interactive and static map widgets for…
permissive · top 15,000 on PyPI
ipyleafletipyleaflet embeds interactive Leaflet maps…
permissive · top 15,000 on PyPI
jupyter-leafletjupyter-leaflet provides interactive map…
permissive · top 15,000 on PyPI
foliumfolium builds interactive web maps by combining…
permissive · top 5,000 on PyPI
django-bootstrap5Provides Django template tags and filters to…
permissive · top 15,000 on PyPI
django-bootstrap3Provides Django template tags and filters to…
permissive · top 15,000 on PyPI
django-bootstrap4Provides Django template tags and filters to…
permissive · top 15,000 on PyPI
django-js-assetAdds script, stylesheet, and JSON tags with…
permissive · top 5,000 on PyPI
CartopyCartopy makes it easy to draw maps for data…
permissive · top 5,000 on PyPI
highcharts-mapsHighcharts Maps for Python wraps the Highcharts…
unclear · top 15,000 on PyPI