{"id":21152,"library":"django-leaflet","title":"django-leaflet","description":"django-leaflet provides a Django map widget for displaying and editing OpenStreetMap / Leaflet maps in admin and front-end forms. Version 0.33.0 supports Python >=3.10, Leaflet 1.7+. Release cadence: occasional, with last release in 2024.","status":"active","version":"0.33.0","language":"python","source_language":"en","source_url":"https://github.com/makinacorpus/django-leaflet","tags":["django","leaflet","gis","map","widget","admin"],"install":[{"cmd":"pip install django-leaflet","lang":"bash","label":"pip"}],"dependencies":[{"reason":"Required: Django map widget","package":"django","optional":false}],"imports":[{"wrong":"from leaflet import LeafletWidget","symbol":"LeafletWidget","correct":"from leaflet import LeafletWidget"}],"quickstart":{"code":"INSTALLED_APPS = [\n    'leaflet',\n    'django.contrib.gis',\n    # ...\n]\n\nLEAFLET_CONFIG = {\n    'DEFAULT_CENTER': (51.5, -0.09),\n    'DEFAULT_ZOOM': 5,\n    'MIN_ZOOM': 3,\n    'MAX_ZOOM': 18,\n}\n\n# In your admin.py:\nfrom leaflet.admin import LeafletGeoAdmin\nfrom django.contrib.gis import admin\n\nclass LocationAdmin(LeafletGeoAdmin):\n    pass\n\nadmin.site.register(Location, LocationAdmin)","lang":"python","description":"Add 'leaflet' to INSTALLED_APPS, configure LEAFLET_CONFIG, then use LeafletGeoAdmin for your GIS model admin."},"warnings":[{"fix":"Update Django to 3.2+ or use django-leaflet==0.28.2.","message":"django-leaflet dropped support for Django <3.2 in version 0.29.0. If upgrading from an older version, ensure Django >=3.2 or pin to 0.28.x.","severity":"breaking","affected_versions":">=0.29.0"},{"fix":"Update your LEAFLET_CONFIG tiles to 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'.","message":"Leaflet 1.0+ changed tile layer URLs; default OSM tile URL changed from http to https. If you override tiles via LEAFLET_CONFIG, ensure you use protocol-relative or https URLs.","severity":"breaking","affected_versions":">=0.30.0 (Leaflet 1.7+)"},{"fix":"Use forms.PointField(widget=LeafletWidget()) in your form or model form.","message":"LeafletWidget displays a map but does not handle form submission validation for geometry fields. You must use a GeoDjango form field (e.g., PointField, PolygonField) in your form; LeafletWidget is just the rendering widget.","severity":"gotcha","affected_versions":"all"},{"fix":"Replace 'from leaflet.extras import LeafletGeoAdmin' with 'from leaflet.admin import LeafletGeoAdmin'.","message":"The 'leaflet.extras' module (ExtraAdminMixin, etc.) is deprecated in favor of directly using LeafletGeoAdmin or custom admin. It may be removed in a future release.","severity":"deprecated","affected_versions":">=0.30.0"}],"env_vars":null,"search_vec":"'0.33.0':27 '1.7':32 '2024':40 '3.10':30 'admin':20,46 'cadenc':34 'display':13 'django':2,5,9,41 'django-leaflet':1,4 'edit':15 'end':24 'form':25 'front':23 'front-end':22 'gis':43 'last':37 'leaflet':3,6,17,31,42 'map':10,18,44 'occasion':35 'openstreetmap':16 'provid':7 'python':29 'releas':33,38 'support':28 'version':26 'widget':11,45","created_at":"2026-04-27T16:58:21.538976+00:00","updated_at":"2026-04-27T16:58:21.538976+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\n  File \"/tmp/tmpqzllkjdk/venv/lib/python3.12/site-packages/leaflet/__init__.py\", line 13, in <module>\n    LEAFLET_CONFIG = getattr(settings, 'LEAFLET_CONFIG', {})\n                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  "},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.33.0","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/makinacorpus/django-leaflet","docs":null,"changelog":"https://github.com/makinacorpus/django-leaflet/blob/master/CHANGES","pypi":"https://pypi.org/project/django-leaflet/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["web-framework","aws","gcp","azure","data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}