django-address-app
Welcome to Django Address
Quickstart
Install
pip install django-address-app
Add them to your INSTALLED_APPS:
INSTALLED_APPS = [
...
'django_address',
...
]
If you want to use your models and don't want to subclass Abstract models, you must inform django_address about your models in settings.py:
# myproject/settings.py
DJANGO_ADDRESS_COUNTRY_MODEL = "my_app.Country"
DJANGO_ADDRESS_REGION_MODEL = "my_app.Region" # or my_app.State, my_app.Province, etc..
DJANGO_ADDRESS_DISTRICT_MODEL = "my_app.District" # or my_app.County
DJANGO_ADDRESS_LOCALITY_MODEL = "my_app.Locality"
DJANGO_ADDRESS_STREET_MODEL = "my_app.Street"
DJANGO_ADDRESS_ADDRESS_MODEL = "my_app.Address"
If you want change behavior processing AddressField, you can use your Service
# myproject/settings.py
DJANGO_ADDRESS_SERVICE_CLASS = "django_address.service.Address"
Example
from django.db import models
from django_address.fields import AddressField
class Order(models.Model):
"""Order model."""
delivery_address = AddressField(verbose_name="Delivery address")
Setting value:
using dict - required field 'raw' only
obj.address = {
"raw": "Volodymyrska st, 10",
"country": "Ukraine", # can use pk or instance country model
"country_code": "UA",
"region": "Kyiv City", # can use pk or instance Region model
"region_code": "UA-32",
"district": "", # can use pk or instance District model
"district_code": "",
"locality": "Kiev",
"street": "Volodymyrska street", # can use pk or instance Street model
"street_number": "10",
"postal_code": "02000",
"latitude": 50.456302,
"longitude": 30.517044,
"formatted_address": "Khreschatyk St, 15, Kyiv, Ukraine, 02000",
}
or
obj.address = address # pk or Address model instance
Prerequisites
You will need:
python3.8(seepyproject.tomlfor full version)djangowith version3.0
Development
When developing locally, we use:
editorconfigplugin (required)pipenv(required)pycharm 2017+orvscode
Alternatives
Metadata
Release files for django-address-app 0.1.13
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 | Actions |
|---|---|---|---|---|
| django-address-app-0.1.13.tar.gz | 11.0 kB | Without provenance | Details for django-address-app-0.1.13.tar.gz |
Release files / django-address-app-0.1.13.tar.gz
| Download URL | django-address-app-0.1.13.tar.gz |
|---|---|
| Size | 11.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7f315a6577e57e4a90555483a2713485ab22a094a93b4fbffde8fb3a04f038c7
|
|
BLAKE2b-256 checksum How to use checksums |
f2e98f9f76dd13a4d8f7d036d11435920ca5729ac11e9af6ef786f3bf1392c88
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.6
|
Security for django-address-app 0.1.13
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.