Skip to main content
https://badge.fury.io/py/django-easy-maps.svg https://img.shields.io/pypi/pyversions/django-easy-maps.svg https://img.shields.io/pypi/djversions/django-easy-maps.svg https://github.com/bashu/django-easy-maps/actions/workflows/test.yml/badge.svg

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

Maintained by Basil Shubin, and some great contributors.

Installation

First install the module, preferably in a virtual environment. It can be installed from PyPI:

pip install django-easy-maps

Setup

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

INSTALLED_APPS += [
    'easy_maps',
]

Then run ./manage.py migrate to create the required database tables.

Configuration

The only mandatory configuration is the EASY_MAPS_GOOGLE_KEY variable:

EASY_MAPS_GOOGLE_KEY = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___0123456789'

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

EASY_MAPS_CENTER = (-41.3, 32)

Other optional settings:

# Optional
EASY_MAPS_ZOOM = 8  # Default zoom level, see https://developers.google.com/maps/documentation/javascript/tutorial#MapOptions for more information.
EASY_MAPS_LANGUAGE = 'ru'  # See https://developers.google.com/maps/faq#languagesupport for supported languages.

Please see the 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.8 or above to run that. It might run on older versions but that is not tested.

Usage

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

{% load easy_maps_tags %}

Use:

{% 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 %}

Templates

If the default map template is not sufficient then a 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 the rendered template as well.

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

Please refer to https://developers.google.com/maps/documentation/javascript/ for detailed Google Maps JavaScript API help.

Widgets

django-easy-maps provides a basic widget that displays a map under the address field. It can be used in the 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'})
            }

admin.site.register(Firm, FirmAdmin)

address field should be either a CharField or TextField.

Contributing

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!

Credits

django-easy-maps was originally started by Mikhail Korobov who has now unfortunately abandoned the project.

License

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

Changes

1.1.5 (2026-08-17)

  • Fixed HasExceptionFilter in the admin not actually filtering on the exception field, making its “Yes”/”No” options a no-op.

  • Fixed AddressAdmin’s address field silently losing its map-preview widget (AddressWithMapWidget) due to an unwired form override introduced by the 1.1.4 modernization pass.

1.1.4 (2026-08-16)

  • Dropped support for Python < 3.10 and Django < 5.2; added support for Python 3.10-3.14 and Django 5.2, 6.0 and 6.1.

  • Fixed Address using the legacy AutoField instead of BigAutoField for its primary key (#84).

1.1.3 (2021-10-09)

  • Removed deprecaded code, various bugfixes.

1.1.2 (2020-10-02)

  • Added support for Python 3.9

1.1.1 (2020-07-04)

  • Dropped support for Python 2.x

1.1.0 (2020-02-29)

  • Added support for Django 3.x.

1.0.2 (2019-05-28)

  • Check is EASY_MAPS_GOOGLE_MAPS_API_KEY is not None before raising warning.

1.0.1 (2019-04-21)

  • Fixed using callback for a non computed address

1.0.0 (2019-03-29)

  • Added new option EASY_MAPS_ZOOM (16 by default).

  • Added new option EASY_MAPS_LANGUAGE (‘en’ by default).

  • EASY_MAPS_GOOGLE_MAPS_API_KEY deprecated in favor of historical EASY_MAPS_GOOGLE_KEY option.

0.9.4 (2019-03-28)

  • Added support for Django 2.x, dropped support for Django < 1.11. It may still work with Django 1.8, but this is no longer tested.

  • Make sure GoogleV3 geocoder respect API key.

0.9.3 (2016-11-11)

  • Google Maps API key configuration.

  • Revert from setuptools back to distutils.

  • Russian translation is added.

0.9.2 (2015-07-12)

  • Replacing broken 0.9.1 release, back to setuptools.

0.9.1 (2015-07-02)

  • Resolve the 500 error when google send a no results info.

  • Resolving width / height and other variables in template.

0.9.0 (2014-02-11)

  • Backwards incompatible: added support for geopy >= 0.96, dropped support for geopy < 0.96.

  • Added support for Django 1.6, dropped support for Django 1.3. It may still work with Django 1.3, but this is no longer tested.

  • Experimental Python 3.3 support (no code changes - app seems to work as-is).

0.8.4 (2013-08-27)

  • fix bad 0.8.3 release

0.8.3 (2013-08-27)

  • easy_map tag now works when address is None.

0.8.2 (2013-07-02)

  • Unique constraint is added to Address.address field (to prevent MultipleObjectsReturned exceptions).

    In order to upgrade, run

    python manage.py migrate easy_maps

  • German translation is added.

0.8.1 (2013-03-25)

  • Fix regressions in geocoding errors handling introduced in 0.8.

0.8.0 (2013-03-24)

  • Testing improvements;

  • EASY_MAPS_CENTER setting for default map coordinates;

  • allow to pass an Address instance as argument of easy_map tag;

  • better error handling;

  • switch to GoogleV3 geocoder;

  • customization hook: it is now possible to use a custom geocoding method;

  • EASY_MAPS_GOOGLE_KEY now does nothing (it is not a meaningful option for V3 Geocoding API).

Minimum required Django version is 1.3 since this release. It may work with older versions, but this is untested.

0.7.4 (2013-01-03)

  • switch to https;

  • make example settings Django 1.4 compatible;

0.7.3 (2012-09-21)

  • use only first placemark from geocoder.

0.7.2 (2012-01-07)

  • static fallback for map.html;

  • fix localization of floats.

0.7.1 (2011-01-31)

  • better error handling;

  • EASY_MAPS_GOOGLE_KEY setting.

0.7.0 (2010-12-24)

  • longtitude -> longitude;

  • display is fixed for comma-delimited float locales.

0.6.0 (2010-12-02)

  • admin preview widget;

  • bugfixes.

0.5.0 (2010-12-01)

  • Initial release

Download files

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

Source Distribution

django_easy_maps-1.1.5.tar.gz (18.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_easy_maps-1.1.5-py3-none-any.whl (23.9 kB view details)

Uploaded Python 3

File details

Details for the file django_easy_maps-1.1.5.tar.gz.

File metadata

  • Download URL: django_easy_maps-1.1.5.tar.gz
  • Upload date:
  • Size: 18.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for django_easy_maps-1.1.5.tar.gz
Algorithm Hash digest
SHA256 54f88ad94a00b657768d3e644c06c668898e6ff1062eb2bf44cd96b80ebc827f
MD5 1806dc3713f2e3a8eb13a4dee005129d
BLAKE2b-256 449d2af6b30269449b8aed34c20069ce03f685db72b9bf08bffbc1538fd75495

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_easy_maps-1.1.5.tar.gz:

Publisher: release.yml on bashu/django-easy-maps

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_easy_maps-1.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for django_easy_maps-1.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 28ace92ba2100efbf9f8c80395907c9dc48b6037c2639b674322467eb6ec4173
MD5 939af480b37be5149a89c0c3ac7eb603
BLAKE2b-256 d080a17a35877fadeccd8f95ac37d6d024bf660660a0a57f974df88f5ee0f3fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_easy_maps-1.1.5-py3-none-any.whl:

Publisher: release.yml on bashu/django-easy-maps

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.1.5 This release

2 files

1.1.4

2 files

1.1.3

2 files

1.1.2

2 files

1.1.1

2 files

1.1.0

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.9.4

2 files

0.9.3

2 files

0.9.2

1 file

0.9

1 file

0.8.4

1 file

0.8.3

1 file

0.8.2

1 file

0.8.1

1 file

0.8

1 file

0.7.4

1 file

0.7.3

1 file

0.7.2

1 file

0.7.1

1 file

0.7

1 file

0.6

1 file

0.5.4

1 file

0.5.3

1 file

0.5.2

1 file

0.5.1

1 file

0.5

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page