django-geoaddress
Django integration for address verification and geocoding. Provides Django fields, widgets, and admin integration for the geoaddress library.
Installation
pip install django-geoaddress
Features
- Django Model Fields:
GeoaddressFieldfor storing address data in Django models - Autocomplete Widget: Interactive address autocomplete widget with real-time suggestions
- Admin Integration: Django admin interface for managing addresses and providers
- Multiple Providers: Support for multiple geocoding providers (Google Maps, Mapbox, Nominatim, etc.)
- Virtual Models: Uses
django-virtualquerysetfor dynamic provider and address models - Address Management: View, search, and manage addresses through Django admin
Quick Start
1. Add to INSTALLED_APPS
INSTALLED_APPS = [
# ...
'django_geoaddress',
]
2. Include URLs
# urls.py
from django.urls import path, include
urlpatterns = [
# ...
path('geoaddress/', include('django_geoaddress.urls')),
]
3. Use in Models
from django.db import models
from django_geoaddress.fields import GeoaddressField
class MyModel(models.Model):
address = GeoaddressField()
# ... other fields
4. Use in Forms
The GeoaddressField automatically uses the GeoaddressAutocompleteWidget which provides:
- Real-time address autocomplete
- Address search across multiple providers
- Structured address data storage
Address Field
The GeoaddressField stores address data as JSON with the following structure:
{
"text": "Full formatted address string",
"reference": "Backend reference ID",
"address_line1": "Street number and name",
"address_line2": "Building, apartment (optional)",
"city": "City name",
"postal_code": "Postal/ZIP code",
"state": "State/region/province",
"country": "Country name",
"country_code": "ISO country code (e.g., FR, US, GB)",
"latitude": 48.8566,
"longitude": 2.3522,
"backend_name": "nominatim",
"geoaddress_id": "nominatim-123456"
}
Admin Interface
Django-geoaddress provides admin interfaces for:
- Address Management: View and manage addresses with search and filtering
- Provider Management: View available geocoding providers and their capabilities
- Address Autocomplete: Interactive autocomplete in admin forms
Access the admin at:
- Addresses:
/admin/django_geoaddress/address/ - Providers:
/admin/django_geoaddress/provider/
Supported Providers
The library supports multiple geocoding providers through the geoaddress library:
Free providers (no API key required):
- Nominatim (OpenStreetMap)
- Photon (Komoot/OSM)
Paid/API key providers:
- Google Maps
- Mapbox
- LocationIQ
- OpenCage
- Geocode Earth
- Geoapify
- Maps.co
- HERE
Configuration
Provider Configuration
Configure geocoding providers in your Django settings or through environment variables. Each provider may require API keys or specific configuration.
Example:
# settings.py
GEOADDRESS_PROVIDERS = {
'google_maps': {
'api_key': 'your-api-key',
},
'mapbox': {
'api_key': 'your-api-key',
},
}
Requirements
- Django >= 3.2
- Python >= 3.10
- geoaddress (automatically installed as dependency)
- django-virtualqueryset (for virtual models)
Development
# Clone the repository
git clone https://github.com/octolo/django-geoaddress.git
cd django-geoaddress
# Install in development mode
pip install -e .
pip install -e ".[dev]"
License
MIT License - see LICENSE file for details.
Links
- Homepage: https://github.com/octolo/django-geoaddress
- Repository: https://github.com/octolo/django-geoaddress
- Issues: https://github.com/octolo/django-geoaddress/issues
- geoaddress library: https://github.com/octolo/python-geoaddress
Metadata
Release files for django-geoaddress 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| django_geoaddress-1.0.3.tar.gz | 35.2 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_geoaddress-1.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 83.1 kB
Release files / django_geoaddress-1.0.3.tar.gz
| Download URL | django_geoaddress-1.0.3.tar.gz |
|---|---|
| Size | 35.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3ba97b6725751575089ef9ea52fe54fc6684561e069e66450e8d5a335baa79ff
|
|
BLAKE2b-256 checksum How to use checksums |
5f7e6043d6488d4ab92ed9fa6c8b60a578d0eebc54bd8916010a2fef74111df7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 9, 2026.
Transparency logRelease files / django_geoaddress-1.0.3-py3-none-any.whl
| Download URL | django_geoaddress-1.0.3-py3-none-any.whl |
|---|---|
| Size | 47.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
432d348c54d51902361008f7ab69c268ac37bfc171ad539227d2fc73be9c01a0
|
|
BLAKE2b-256 checksum How to use checksums |
2a396667e24e2895686b84ec437d78af9bdfa0f3bd17e92355bf5df1856d2c11
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 9, 2026.
Transparency logSecurity for django-geoaddress 1.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for django_geoaddress-1.0.3.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 9, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.