Skip to main content

A django app for store places using Google Maps API

Project description


A Django app for store places with autocomplete function and a related map to the selected place.


PyPI Travis-ci Codacy Badge


Install dj-places and add it to your installed apps:

$ pip install dj-places


Add the following settings and maps api key ( read more here ):

PLACES_MAP_OPTIONS='{"center": { "lat": 38.971584, "lng": -95.235072 }, "zoom": 10}'
PLACES_MARKER_OPTIONS='{"draggable": true}'

Then use it in a project:

from django.db import models
from places.fields import PlacesField

class MyLocationModel(models.Model):
    location = PlacesField()

This enables the following API:

    >>> from myapp.models import ModelName
    >>> poi = ModelName.objects.get(id=1)
    >>> poi.position
    Place('Metrocentro, Managua, Nicaragua', 52.522906, 13.41156)
    'Metrocentro, Managua, Nicaragua'
    >>> poi.position.latitude
    >>> poi.position.longitude

For using outside the Django Admin:

<form method="post">
    {% csrf_token %}
    {{ form.as_p }}
    <input type="submit" value="Save">
    {{ }}

Remember to add the {{ }} in your template.


Running Tests

Does the code actually work?

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install -r requirements_test.txt
(myenv) $ python


Tools used in rendering this package:

Similar Projects



Full Changelog

Implemented enhancements:

  • Update for Django 3.0 #24 (dryan)

Closed issues:

  • Deprecated Field._get_val_from_obj() #25

v3.1.0 (2018-10-30)

Full Changelog

Implemented enhancements:

  • Support marker options and set marker as draggable #22 (oscarmcm)

Fixed bugs:

  • Empty Map in admin #16

v3.0.0 (2018-10-29)

Full Changelog

Implemented enhancements:

Fixed bugs:

  • Multiple PlacesField() Objects declaration in one Model clones data from one Object to the other. #14
  • Remove jquery geocomplete #19 (oscarmcm)

v2.0.0 (2017-09-10)

Full Changelog

Implemented enhancements:

Fixed bugs:

  • Django 1.11 not render widget #9

v1.1.4 (2017-05-08)

Full Changelog

Fixed bugs:

  • undefined name Location #10

v1.1.3 (2017-05-07)

Full Changelog

Fixed bugs:

  • Kwargs problem #8
  • Problems with djplaces #6
  • i18n support #3

v1.1.2 (2017-05-07)

Full Changelog

v1.1.1 (2017-01-22)

Full Changelog

v1.1.0 (2017-01-09)

Full Changelog

v1.0.5 (2016-07-26)

Full Changelog

Implemented enhancements:

  • Add own jquery to avoid conflicts and be able to used in admin and templates #5 (darwing1210)

v1.0.4 (2016-07-20)

Full Changelog

v1.0.3 (2016-06-01)

Full Changelog

v1.0.2 (2016-05-12)

Full Changelog

v1.0.1 (2016-05-12)

Full Changelog

Fixed bugs:

  • Geocomplete is not a function #1

Merged pull requests:

  • Fixes #1 Geocomplete is not a function #2 (oscarmcm)

v1.0.0 (2016-04-28)

Full Changelog

* This Changelog was automatically generated by github_changelog_generator

Project details

Download files

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

Source Distribution

dj-places-5.1.0.tar.gz (8.8 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page