Pluggable postcode lookup endpoint
Project description
This Django app providers a pluggable postcode django rest framework endpoint. It currently only works for postcodes in The Netherlands.
- Currently supports the following services:
ApiWise
Webservices.nl
postcodeapi.nu
Status
Installation
pip install django_postcode_lookup
Usage
Add the following to your urls.py:
path('postcode-lookup/', include('django_postcode_lookup.urls')),
Add a setting with the required backend
Webservices:
POSTCODE_LOOKUP = {
'default': {
'backend': 'django_postcode_lookup.backends.Webservices',
'OPTIONS': {
'username': 'someuser',
'password': 'somepassword',
}
}
}
ApiWise:
POSTCODE_LOOKUP = {
'default': {
'backend': 'django_postcode_lookup.backends.ApiWise',
'OPTIONS': {
'api_key': 'somekey',
}
}
}
postcodeapi.nu:
POSTCODE_LOOKUP = {
'default': {
'backend': 'django_postcode_lookup.backends.PostcodeApiNu',
'OPTIONS': {
'api_key': 'somekey',
'base_url': 'https://somebaseurl.com',
}
}
}
To offer some form of protection to the api endpoint for usage by others a valid csrf token is required.
Project details
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
File details
Details for the file django-postcode-lookup-1.0.tar.gz
.
File metadata
- Download URL: django-postcode-lookup-1.0.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e872df37825b0aa6592a8451aecb23a896fb9bfb6ab71b0b4bafe92b8bc0eaa9 |
|
MD5 | 3cdcef3aaa7ab6927be2fbd5d1db161f |
|
BLAKE2b-256 | c34b475d4329c31b8315c519a63bfa5935c9a36eddfa1951e1ef7044fe8a7aca |
File details
Details for the file django_postcode_lookup-1.0-py2.py3-none-any.whl
.
File metadata
- Download URL: django_postcode_lookup-1.0-py2.py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05b1b55cad847b19ebd8b4110b62e23be2bd1ceab73d8cfc3aaf8716504f0e02 |
|
MD5 | c9e7da200379034eee95fc5444253091 |
|
BLAKE2b-256 | 79e17640389e5c402df38c952168dfb71946ded2fa79e5262633f8583c545a0b |