Django ISTAT API italian places
Django ISTAT is a Django app to localize the ISTAT API. The result is a Django app that you can plug into your existing Django project to localize the ISTAT API.
The resources are: Region, Provinces and Cities.
The data are taken from the ISTAT API (https://www.istat.it/it/archivio/6789)
Detailed documentation is in the “docs” directory.
Quick start
Add “comuni_italiani”, “rest_framework” and “django_filters” to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [ ..., "rest_framework", "django_filters", "comuni_italiani", ]The API filters and ?search= rely on the django-filter and DRF search backends:
REST_FRAMEWORK = { "DEFAULT_FILTER_BACKENDS": [ "django_filters.rest_framework.DjangoFilterBackend", "rest_framework.filters.SearchFilter", ], }Include the polls URLconf in your project urls.py like this:
path("comuni_italiani/", include("comuni_italiani.urls")),Run python manage.py migrate to create the comuni_italiani models.
Start the development server
Run the management command to populate the database with the ISTAT API data:
``python manage.py import_istat_data`` (If use the --force option, the command start without asking for confirmation)
Visit http://127.0.0.1:8000/comuni-italiani/ to view the API index.
Visit http://127.0.0.1:8000/comuni-italiani/regioni/ to view the API regioni.
Visit http://127.0.0.1:8000/comuni-italiani/province/ to view the API province.
Visit http://127.0.0.1:8000/comuni-italiani/comuni/ to view the API cities.
Metadata
Release files for django-istat-italian-places 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django_istat_italian_places-0.4.0.tar.gz | 16.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_istat_italian_places-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 44.7 kB
Release files / django_istat_italian_places-0.4.0.tar.gz
| Download URL | django_istat_italian_places-0.4.0.tar.gz |
|---|---|
| Size | 16.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
291426becf5b6534e024ed7e286171d6cf75849de9540300550d7c922564a290
|
|
BLAKE2b-256 checksum How to use checksums |
b70a355badf1336ebc0c4a56b7472b76f607de1a2f95992b4e5b7ccd4478b345
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Release files / django_istat_italian_places-0.4.0-py3-none-any.whl
| Download URL | django_istat_italian_places-0.4.0-py3-none-any.whl |
|---|---|
| Size | 27.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6a70404c3ed8dcc5d578787db75192d201b702c960dd75ca9dee7ae118470466
|
|
BLAKE2b-256 checksum How to use checksums |
407caf500edd8b6edd266df379246315e7255b9dc9866a281c93020e4cb475b3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|