Skip to main content

django-postcode-lookup

This Django app provides 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

PyPI

Installation

pip install django_postcode_lookup

Minimum supported Django version: 5.2 (Django 6 supported)

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.

Changelog and releases

This project uses changie for changelog management.

Add a changelog fragment in pull requests with:

changie new

To prepare a release, run the Prepare release PR GitHub Actions workflow. It batches unreleased fragments, updates CHANGELOG.md and version files, then opens a release pull request. Merging that release PR publishes the package and creates the GitHub release from the changelog entry.

Metadata

Release files for django-postcode-lookup 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-postcode-lookup 2.0.0
File Size Uploaded
django_postcode_lookup-2.0.0.tar.gz 56.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-postcode-lookup 2.0.0
File Interpreter ABI Platform
django_postcode_lookup-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 67.3 kB

Release files / django_postcode_lookup-2.0.0.tar.gz

Download URL django_postcode_lookup-2.0.0.tar.gz
Size 56.9 kB
Tags Source
SHA-256 checksum
How to use checksums
470196e828a0a660a2f3f35c92353b5249e4ee653f2b3838d7cd86254ad49839
BLAKE2b-256 checksum
How to use checksums
7bb3575f6d730e8d41f864b224a28b903ed71ffa77fcf94b3bdea4260d16cae4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / django_postcode_lookup-2.0.0-py3-none-any.whl

Download URL django_postcode_lookup-2.0.0-py3-none-any.whl
Size 10.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1eb20a82dda6c7dfdd3694e0e9d1df3e4801d376e3599e1cf23dd67a2d1ea0f3
BLAKE2b-256 checksum
How to use checksums
a961dbd639b00f7bfc614272ac504f847f5fa1232793e6305619692659a4fddc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.0.1

2 release files

1.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page