Skip to main content

A django app for store places

Project description


django-places
=============================

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

Badges
---------

[![PyPI](https://badge.fury.io/py/dj-places.png)](https://badge.fury.io/py/dj-places)
[![Travis-ci](https://travis-ci.org/oscarmcm/django-places.png?branch=master)](https://travis-ci.org/oscarmcm/django-places)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/d6433fc7fc384f63b9f41fc251ee70b1)](https://www.codacy.com/app/om-cortez-2010/django-places?utm_source=github.com&utm_medium=referral&utm_content=oscarmcm/django-places&utm_campaign=Badge_Grade)

Quickstart
----------

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

$ pip install dj-places

INSTALLED_APPS = (
...
'places',
...
)

Add the following settings and maps api key ( [read more here](https://developers.google.com/maps/documentation/javascript/3.exp/reference) ):

PLACES_MAPS_API_KEY='YourAwesomeUltraSecretKey'
MAP_WIDGET_HEIGHT=480
MAP_OPTIONS={}
MARKER_OPTIONS={}

Then use it in a project:

from places.fields import PlacesField
location = PlacesField()

This enables the following API:

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

Demo
------

![](http://g.recordit.co/LheQH0HDMR.gif)

TODO-LIST
--------

* [ ] Write some test ASAP!
* [ ] Support Inline Admin

Running Tests
--------------

Does the code actually work?

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install -r requirements-test.txt
(myenv) $ python runtests.py

Credits
---------

Tools used in rendering this package:

* [Cookiecutter](https://github.com/audreyr/cookiecutter)
* [cookiecutter-djangopackage](https://github.com/pydanny/cookiecutter-djangopackage)
* [jquery-geocomplete](https://github.com/ubilabs/geocomplete)

Similar Projects
------------

* [Django Location Field](https://github.com/caioariede/django-location-field)
* [Django GeoPosition](https://github.com/philippbosch/django-geoposition)

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-1.1.1.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

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

dj_places-1.1.1-py2.py3-none-any.whl (7.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file dj-places-1.1.1.tar.gz.

File metadata

  • Download URL: dj-places-1.1.1.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for dj-places-1.1.1.tar.gz
Algorithm Hash digest
SHA256 48a8ed1e9f8bc162e9ac56a17c75b907e21a46f8f5cb89e49dd6219e91ce58fc
MD5 4713d286544230d4d2cf3bf3abf30f2c
BLAKE2b-256 be7837cc01487d54dd3ddbde3950c380f7ee3872a81ff7a424dc227b3a1920ee

See more details on using hashes here.

File details

Details for the file dj_places-1.1.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for dj_places-1.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2dad053b481be106cbd1703f1abccda3641035e146b218e88741911d5e501a9f
MD5 24d15f0072e6687a65e7678d43403f2f
BLAKE2b-256 ea319fdccf4ffc7ecc725731fefe921558cb44331ffd2aebe1feb32662593b24

See more details on using hashes here.

Supported by

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