Metadata-Version: 2.4
Name: django-istat-italian-places
Version: 0.4.0
Summary: A Django app to add ISTAT data resources Regions, Provinces and Cities from updated Official CSV file.
Author-email: Francesco Cataldo <francy111200@gmail.com>
License-Expression: BSD-3-Clause
Project-URL: Homepage, https://github.com/FraCata00/django-istat-italian-places
Project-URL: Issues, https://github.com/FraCata00/django-istat-italian-places/issues
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 4.2
Classifier: Framework :: Django :: 5.2
Classifier: Framework :: Django :: 6.0
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Requires-Python: >=3.10
Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: Django>=4.2
Requires-Dist: djangorestframework>=3.14
Requires-Dist: django-filter>=23.0
Requires-Dist: requests>=2.25
Dynamic: license-file

|license| |release| |deepwiki| |build| |issues| |codeql|

.. |license| image:: https://img.shields.io/github/license/FraCata00/django-istat-italian-places
   :alt: License

.. |release| image:: https://img.shields.io/github/v/release/FraCata00/django-istat-italian-places
   :alt: GitHub release

.. |deepwiki| image:: https://deepwiki.com/badge.svg
   :target: https://deepwiki.com/FraCata00/django-istat-italian-places
   :alt: Ask DeepWiki

.. |build| image:: https://img.shields.io/github/actions/workflow/status/FraCata00/django-istat-italian-places/python-publish.yml
   :alt: Build status

.. |issues| image:: https://img.shields.io/github/issues/FraCata00/django-istat-italian-places
   :alt: GitHub issues

.. |codeql| image:: https://github.com/FraCata00/django-istat-italian-places/workflows/CodeQL/badge.svg
   :target: https://github.com/FraCata00/django-istat-italian-places/actions?query=workflow%3ACodeQL
   :alt: CodeQL

===============================
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
-----------

1. 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",
        ],
    }

2. Include the polls URLconf in your project urls.py like this::

    path("comuni_italiani/", include("comuni_italiani.urls")),

3. Run ``python manage.py migrate`` to create the comuni_italiani models.

4. Start the development server

5. 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)

6. Visit http://127.0.0.1:8000/comuni-italiani/ to view the API index.

7. Visit http://127.0.0.1:8000/comuni-italiani/regioni/ to view the API regioni.

8. Visit http://127.0.0.1:8000/comuni-italiani/province/ to view the API province.

9. Visit http://127.0.0.1:8000/comuni-italiani/comuni/ to view the API cities.
