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
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.1.0 (2018-11-13)
First release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django-geonames-place-0.6.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45aa4ab3b71eb6dafcbb46f300bcdb48ed71df06f23865aced3d2b6d8b103671 |
|
MD5 | 0df84ec17896f92ecc84cfbce5ea7f05 |
|
BLAKE2b-256 | 3b2142c234795e744cbca676ff989bae0bdd0135084a6aee75f90d1d583a246b |
Hashes for django_geonames_place-0.6.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f914cf8af5ccd0841dcb5f6f241218c17805bb5e365443b4066e53a75b28b828 |
|
MD5 | c8139681d0c1493bfa63fa1fc3295430 |
|
BLAKE2b-256 | 9afd938ec064fcc2efefc93f869168e5ba155580eac3d13e92c518f06f111fcd |