grayhound / django-gmap-admin

Using the Google Maps API with django model admin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A simple modelfield, formfield and widget combination to allow a user pick a single location via google maps in the django admin (without needing to install GeoDjango etc!).

In this fork, I have removed address geocoding (you manually pick a location on the map) and I also incorperated a default formfield so you don't have to mess with ModelAdmins - just add the modelfield to your model.

Screenshot

USAGE:

  • include the gmap_admin app in your settings.py
  • create a model that has a GeoLocationField field
    
      from django.db import models
      from gmap_admin.fields import GeoLocationField
      
      class Rental(models.Model):
          geolocation = GeoLocationField(max_length=100)    
    

That should be all you need to get started. If you're not using Django 1.3 make sure that the static media is in a location that will be found and properly served. The assumed location is settings.STATIC_URL + 'django_google_maps/js/google-maps-admin.js',

About

Using the Google Maps API with django model admin

License:BSD 2-Clause "Simplified" License


Languages

Language:Python 82.9%Language:JavaScript 17.1%