Skip to main content

Application to access Geonames Places directly from Django. The application can create places by using a geonames id or by using a search address.

Project description

https://travis-ci.org/kingsdigitallab/django-geonames-place.svg?branch=master https://codecov.io/gh/kingsdigitallab/django-geonames-place/branch/master/graph/badge.svg

Application to access Geonames Places directly from Django. The application can create places by using a geonames id or by using a search address.

This application depends on the very useful Python Geocoder library.

Documentation

The full documentation is at https://django-geonames-place.readthedocs.io.

Quickstart

Install Django Geonames Place:

pip install django-geonames-place

Add it to your INSTALLED_APPS:

INSTALLED_APPS = (
    ...
    'geonames_place.apps.GeonamesPlaceConfig',
    ...
)

Add the settings GEONAMES_KEY and GEONAMES_MAX_RESULTS. The GEONAMES_KEY is your Geoname API key, and the GEONAMES_MAX_RESULTS is used to set the maximum number of results when searching Geonames.

GEONAMES_KEY = '<GEONAMES_USERNAME>'
GEONAMES_MAX_RESULTS = 10

To reference Geonames Place in your models:

from django.db import models
from geonames_place.models import Place


class MyModel(models.Model):
    ...
    place = models.ForeignKey(Place, on_delete=models.CASCADE)
    ...

Running Tests

Does the code actually work?

export GEONAMES_KEY=<GEONAMES_USERNAME>
source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox

Credits

Tools used in rendering this package:

History

0.6.0 (2020-03-30)

  • Added SelectMultiple autocomplete widget.

0.5.0 (2020-03-27)

  • Added autocomplete widget and view to use app outside of Django admin.

0.1.0 (2018-11-13)

  • First release on PyPI.

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

django-geonames-place-0.7.0.tar.gz (11.1 kB view hashes)

Uploaded source

Built Distribution

django_geonames_place-0.7.0-py2.py3-none-any.whl (12.5 kB view hashes)

Uploaded py2 py3

Supported by

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