Skip to main content

Use Leaflet in your django projects

Project description

django-leaflet allows you to use Leaflet (version 0.3) in your Django projects.


pip install django-leaflet


  • Add leaflet to your INSTALLED_APPS
  • Add the HTML header :
{% load leaflet_tags %}

    {% leaflet_js %}
    {% leaflet_css %}
  • Add the map in your page :
    {% leaflet_map "yourmap" %}
  • Use the Leaflet API as usual on the resulting yourmap object :
<script type="text/javascript">
    // Add background layer from MapBox
    yourmap.addLayer(new L.TileLayer('http://{s}{z}/{x}/{y}.png'));
  • Give your maps a size (mandatory) :

    .leaflet-container {
        width:  600px;
        height: 400px;

    #specialbigmap {
        height: 800px;





  • Lesser GNU Public License
  • Leaflet Copyright - 2010-2011 CloudMade, Vladimir Agafonkin

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
django-leaflet-0.0.2.tar.gz (69.2 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page