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.4.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5114479d412cfee42cb90c761e9fd88d754c7a951901e0d751b7a5c34c47cbf1 |
|
MD5 | 7d130dc68b9dfc57dc8a072fc0bd0863 |
|
BLAKE2b-256 | 31322e3a0ec501da938d078ea5f4367be3e9dd2dd13708ac9798aea764c1515b |
Hashes for django_geonames_place-0.4.6-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 457f27eb6b6790425e49b6edbd0408f32d27bb344f46c8e0d63c73aa5648c840 |
|
MD5 | 09a3a8444e8a9536aa4a009e6223f262 |
|
BLAKE2b-256 | 297900f1c00aa734e62c592385662511ab9f0b967af8c02fa28b0d0ef0dea4b2 |