Coder Social home page Coder Social logo

d3rrick / django-places Goto Github PK

View Code? Open in Web Editor NEW

This project forked from oscarmcm/django-places

0.0 1.0 0.0 56 KB

A django app for store places with autocomplete

Home Page: https://pypi.python.org/pypi/dj-places/

License: MIT License

Makefile 5.71% Python 74.53% HTML 13.47% CSS 0.53% JavaScript 5.77%

django-places's Introduction

django-places

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

Badges

PyPI Travis-ci Codacy Badge

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 ):

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:

    >>> 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

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:

Similar Projects

django-places's People

Contributors

oscarmcm avatar pavillet avatar darwing1210 avatar

Watchers

@d3rrick avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.