Installation¶
Stable release¶
To install django-geopostcodes, run this command in your terminal:
$ pip install django-geopostcodes
This is the preferred method to install django-geopostcodes, as it will always install the most recent stable release.
If you don’t have pip installed, this Python installation guide can guide you through the process.
From sources¶
The sources for django-geopostcodes can be downloaded from the Github repo.
You can either clone the public repository:
$ git clone git://github.com/alexhayes/django-geopostcodes
Or download the tarball:
$ curl -OJL https://github.com/alexhayes/django-geopostcodes/tarball/master
Once you have a copy of the source, you can install it with:
$ python setup.py install
Django Settings¶
Then place django_geopostcodes
in your INSTALLED_APPS
;
INSTALLED_APPS = (
...
'django_geopostcodes',
...
)
Data Import¶
django-geopostcodes by itself only provides models and helpers, you must purchase and import the geo post code data from geopostcodes.com.
Upon purchase from geopostcodes.com you will be able to down a zip file that contains files that can be imported into django-geopostcodes.
Currently django-geopostcodes only supports localities, however feel free to fork and add support for regions and businesses.
Once you’ve completed your purchase from geopostcodes.com you will be able
to download a ZIP file containing data in a number of formats. Inside the ZIP
file there should be a folder called CSV
and within this folder should be a
file titled GeoPC_XX_Places.csv
where XX
is the two letter ISO country
code.
You can import this file into django-geopostcodes as follows;
python manage.py import_localities /path/to/GeoPC_XX_Places.csv