This Django app providers a pluggable postcode django restframework endpoint. It currently only works for postcodes in The Netherlands.
- Currently supports the following services:
- ApiWise
- Webservices.nl
pip install django_postcode_lookup
Add the following to your urls.py:
url(r'^postcode-lookup/', include('django_postcode_lookup.urls')),
Add a setting with the required backend
POSTCODE_LOOKUP = {
'default': {
'backend': 'django_postcode_lookup.backends.Webservices',
'OPTIONS': {
'username': 'someuser',
'password': 'somepassword',
}
}
}
To offer some form of protection to the api endpoint for usage by others a valid csrf token is required.