Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/labd/django-postcode-lookup
Generic API for postcode lookups
https://github.com/labd/django-postcode-lookup
django django-rest-framework postcode
Last synced: 3 months ago
JSON representation
Generic API for postcode lookups
- Host: GitHub
- URL: https://github.com/labd/django-postcode-lookup
- Owner: labd
- License: mit
- Created: 2016-12-12T09:46:21.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2022-01-28T16:12:11.000Z (about 3 years ago)
- Last Synced: 2024-05-01T09:49:10.023Z (10 months ago)
- Topics: django, django-rest-framework, postcode
- Language: Python
- Homepage:
- Size: 60.5 KB
- Stars: 8
- Watchers: 9
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGES
- License: LICENSE
Awesome Lists containing this project
README
======================
django-postcode-lookup
======================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.nuStatus
======
.. image:: https://travis-ci.org/LabD/django-postcode-lookup.svg?branch=master
:target: https://travis-ci.org/LabD/django-postcode-lookup.. image:: http://codecov.io/github/LabD/django-postcode-lookup/coverage.svg?branch=master
:target: http://codecov.io/github/LabD/django-postcode-lookup?branch=master
.. image:: https://img.shields.io/pypi/v/django-postcode-lookup.svg
:target: https://pypi.python.org/pypi/django-postcode-lookup/Installation
============.. code-block:: shell
pip install django_postcode_lookup
Usage
=====Add the following to your urls.py:
.. code-block:: python
path('postcode-lookup/', include('django_postcode_lookup.urls')),
Add a setting with the required backend
Webservices:
.. code-block:: python
POSTCODE_LOOKUP = {
'default': {
'backend': 'django_postcode_lookup.backends.Webservices',
'OPTIONS': {
'username': 'someuser',
'password': 'somepassword',
}
}
}ApiWise:
.. code-block:: python
POSTCODE_LOOKUP = {
'default': {
'backend': 'django_postcode_lookup.backends.ApiWise',
'OPTIONS': {
'api_key': 'somekey',
}
}
}postcodeapi.nu:
.. code-block:: python
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.