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.5.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3257a6cdff3d408ae09100bee8bac616cd6a57267abe384946bccefd07bc992b |
|
MD5 | a820f2c2c1a2080b14c89ccc9a042955 |
|
BLAKE2b-256 | b727b018b1ca4e180ffae92009cba8bf853bef92c22ad1dd86029dd9d3ae33ad |
Hashes for django_geonames_place-0.5.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3b1671ae59cd3cdaccb4b869f61582601436a80baee5829c2944b0e766ee168 |
|
MD5 | cc37d06f2eca04a9a9d10448bcfbde4a |
|
BLAKE2b-256 | 2650a9a0ab12fa3c8430d45125ee047c650f30717f320ed641815151e3c18501 |