skip to navigation
skip to content

django-easy-maps 0.9.2

This app makes it easy to display a map for a given address

This app makes it easy to display a map for given address in django templates. No API keys, manual geocoding, html/js copy-pasting or django model changes is needed.

Authored by Mikhail Korobov, and some great contributors.


Either clone this repository into your project, or install with pip install django-easy-maps

You’ll need to add easy_maps to INSTALLED_APPS in your project’s file:

import django


if django.VERSION < (1, 7):

Then run ./ syncdb to create the required database tables

Configuration (optional)

If you need a place where center the map when no address is inserted yet add the latitude and longitude to the EASY_MAPS_CENTER variable in your like the following:

EASY_MAPS_CENTER = (-41.3, 32)

To use a custom geocoder set EASY_MAPS_GEOCODE option:

# Default: 'easy_maps.geocode.google_v3'
EASY_MAPS_GEOCODE = 'example.custom_geocode'

Please see example application. This application is used to manually test the functionalities of this package. This also serves as a good example.

You need Django 1.4 or above to run that. It might run on older versions but that is not tested.


First of all, load the easy_map_tags in every template where you want to use it:

{% load easy_maps_tags %}


{% easy_map <address> [<width> <height>] [<zoom>] [using <template_name>] %}

For example:

{% load easy_maps_tags %}

<!-- Default map with 300x400 dimensions -->
{% easy_map "Russia, Ekaterinburg, Mira 32" 300 400 %}

<!-- Variable address, custom detail level and custom template -->
{% easy_map address 200 200 5 using 'map.html' %}

The coordinates for map will be obtained using google geocoder on first access. Then they’ll be cached in DB. Django’s template caching can be used later in order to prevent DB access on each map render:

{% load easy_maps_tags cache %}

{% cache 600 my_map firm.address %}
    {% easy_map firm.address 300 400 %}
{% endcache %}


If the default map template is not sufficient then custom map template can be used. For example:

{% easy_map address using 'map.html' %}
{% easy_map address 200 300 5 using 'map.html' %}

The template will have map (easy_maps.Address instance auto-created for passed address on first access), width, height and zoom variables. The outer template context is passed to rendered template as well.

You can start your own template from scratch or just override some blocks in the default template.

Please refer to for detailed Google Maps JavaScript API help.


django-easy-maps provides basic widget that displays a map under the address field. It can be used in admin for map previews. For example:

from django import forms
from django.contrib import admin

from easy_maps.widgets import AddressWithMapWidget

from .models import Firm

class FirmAdmin(admin.ModelAdmin):
    class form(forms.ModelForm):
        class Meta:
            widgets = {
                'address': AddressWithMapWidget({'class': 'vTextField'})
            }, FirmAdmin)

address field should be either a CharField or TextField.


If you’ve found a bug, implemented a feature or customized the template and think it is useful then please consider contributing. Patches, pull requests or just suggestions are welcome!


django-easy-maps is released under the MIT license.

File Type Py Version Uploaded on Size
django-easy-maps-0.9.2.tar.gz (md5, pgp) Source 2015-07-12 13KB
  • Downloads (All Versions):
  • 57 downloads in the last day
  • 449 downloads in the last week
  • 2189 downloads in the last month