Skip to main content

Django NUTS

Django application providing database of European NUTS and LAU

Installation

pip install django-nuts

Configuration

Add 'django_nuts' to settings.INSTALLED_APPS.

Data migration

python manage.py migrate

Load / update data

You may load the data manually from the shell (python manage.py shell)

from django_nuts.loaders import load_nuts, load_lau, load_other_nuts

# load all NUTS and LAU (note that NUTS must be loaded before LAU)
load_nuts(), load_ohter_nuts(), load_lau()

# load NUTS and LAU for some particular countries
load_nuts('CZ', 'SK'), load_other_nuts('IS'), load_lau('CZ', 'SK')

# load NUTS4 for CZ or SK
from django_nuts.loaders.cz_nuts import load_cz_nuts
from django_nuts.loaders.sk_nuts import load_sk_nuts
load_cz_nuts(), load_sk_nuts()

# load CZ NUTS4 + LAU
from django_nuts.loaders.cz_nuts4_lau import load_cz_nuts4_lau
load_cz_nuts4_lau()

Filter objects by NUTS in Django Admin Site

your_app/models.py:

from django.db import models
from django_nuts.models import NUTS

class Place(models.Model):
    name = models.CharField(max_length=255)
    nuts = models.ForeignKey(NUTS)

your_app/admin.py:

from django.contrib import admin
from django_nuts.admin import NUTSRelatedOnlyFieldListFilter

class PlaceAdmin(admin.ModelAdmin):
list_display = ('name',)
list_filter = (('nuts', NUTSRelatedOnlyFieldListFilter),)
raw_id_fields = ('nuts',)

Metadata

Release files for django-nuts 1.4.1

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-nuts 1.4.1
File Size Uploaded Provenance Actions
django-nuts-1.4.1.tar.gz 6.3 kB Without provenance Details for django-nuts-1.4.1.tar.gz

Release files / django-nuts-1.4.1.tar.gz

Download URL django-nuts-1.4.1.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ddae98010f16324dae58dd7511eaad02a08818a6c875081638338f9c2d7fec01
BLAKE2b-256 checksum
How to use checksums
e51afefadcb8c8e7aef6b58c8dbd43874738dd51a81e232c34a053897c81066e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.6

Security for django-nuts 1.4.1

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.

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