diff --git a/.flake8 b/.flake8
new file mode 100644
index 0000000..d940ed8
--- /dev/null
+++ b/.flake8
@@ -0,0 +1,5 @@
+[flake8]
+max-line-length = 120
+exclude = migrations/*,node_modules/*,.venv/*
+max-complexity = 12
+
diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml
new file mode 100644
index 0000000..d0c6c3f
--- /dev/null
+++ b/.github/workflows/workflow.yml
@@ -0,0 +1,185 @@
+name: CI
+
+on:
+ push:
+ branches:
+ - main # Change this to the default branch of your repository
+ pull_request:
+ branches:
+ - main # Change this to the default branch of your repository
+ release:
+ types: [published]
+
+jobs:
+ lint:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
+ steps:
+ - uses: actions/checkout@v4
+ - name: Set up Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v3
+ with:
+ python-version: ${{ matrix.python-version }}
+ - name: Install Pipenv
+ run: |
+ python -m pip install --upgrade pip
+ pip install pipenv ruff
+ - name: Install dependencies with Pipenv
+ run: |
+ pipenv install --dev
+ - name: Analysing the code with pylint
+ run: |
+ pipenv run pylint django_country_kit dev project
+ - name: Check code style with flake8
+ run: |
+ pipenv run flake8 .
+ - name: Check import order with isort
+ run: |
+ pipenv run isort --check-only --diff .
+ - name: Linting with Ruff
+ run: |
+ ruff .
+
+ build_django_50:
+ runs-on: ubuntu-latest
+ needs: lint
+ strategy:
+ matrix:
+ python-version: ["3.10", "3.11", "3.12"]
+ django-version: ["5.0"]
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v2
+
+ - name: Set up Python
+ uses: actions/setup-python@v2
+ with:
+ python-version: ${{ matrix.python-version }}
+
+ - name: Install dependencies and setuptools
+ run: |
+ python -m pip install --upgrade pip
+ python -m pip install setuptools
+
+ - name: Install specific Django version
+ run: pip install Django==${{ matrix.django-version }}
+
+ - name: Run tests
+ run: |
+ python manage.py test
+
+ - name: Build distribution package
+ run: python setup.py sdist
+
+ - name: Archive distribution package
+ uses: actions/upload-artifact@v2
+ with:
+ name: dist
+ path: dist/*.tar.gz
+
+ build_django_42:
+ runs-on: ubuntu-latest
+
+ strategy:
+ matrix:
+ python-version: ["3.8", "3.9"]
+ django-version: ["4.2"]
+
+ needs: build_django_50
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v2
+
+ - name: Set up Python
+ uses: actions/setup-python@v2
+ with:
+ python-version: ${{ matrix.python-version }}
+
+ - name: Install dependencies
+ run: |
+ python -m pip install --upgrade pip
+
+ - name: Install specific Django version
+ run: pip install Django==${{ matrix.django-version }}
+
+ - name: Run tests
+ run: |
+ python manage.py test
+
+ - name: Build distribution package
+ run: python setup.py sdist
+
+ - name: Archive distribution package
+ uses: actions/upload-artifact@v2
+ with:
+ name: dist
+ path: dist/*.tar.gz
+
+ build_django_32:
+ runs-on: ubuntu-latest
+
+ strategy:
+ matrix:
+ python-version: ["3.7", "3.8", "3.9"]
+ django-version: ["3.2"]
+
+ needs: build_django_42
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v2
+
+ - name: Set up Python
+ uses: actions/setup-python@v2
+ with:
+ python-version: ${{ matrix.python-version }}
+
+ - name: Install dependencies
+ run: |
+ python -m pip install --upgrade pip
+
+ - name: Install specific Django version
+ run: pip install Django==${{ matrix.django-version }}
+
+ - name: Run tests
+ run: |
+ python manage.py test
+
+ - name: Build distribution package
+ run: python setup.py sdist
+
+ - name: Archive distribution package
+ uses: actions/upload-artifact@v2
+ with:
+ name: dist
+ path: dist/*.tar.gz
+
+ deploy:
+ needs: build_django_32
+ runs-on: ubuntu-latest
+ if: github.event_name == 'release' && github.event.action == 'published'
+ environment: release
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+ - name: Set up Python
+ uses: actions/setup-python@v3
+ with:
+ python-version: '3.x'
+ - name: Install Pipenv
+ run: python -m pip install --upgrade pipenv
+ - name: Install dependencies with Pipenv
+ run: |
+ pipenv install --dev
+ - name: Build package
+ run: pipenv run python -m build
+ - name: Publish package
+ uses: pypa/gh-action-pypi-publish@v1.8.10
+ with:
+ user: __token__
+ password: ${{ secrets.PYPI_API_TOKEN }}
+ packages_dir: dist/
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..3fb58c4
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,142 @@
+# Django #
+*.log
+*.pot
+*.pyc
+__pycache__
+db.sqlite3
+media
+
+# Backup files #
+*.bak
+
+# Static files #
+static/
+
+# If you are using PyCharm #
+# User-specific stuff
+.idea/**/workspace.xml
+.idea/**/tasks.xml
+.idea/**/usage.statistics.xml
+.idea/**/dictionaries
+.idea/**/shelf
+
+# AWS User-specific
+.idea/**/aws.xml
+
+# Generated files
+.idea/**/contentModel.xml
+
+# Sensitive or high-churn files
+.idea/**/dataSources/
+.idea/**/dataSources.ids
+.idea/**/dataSources.local.xml
+.idea/**/sqlDataSources.xml
+.idea/**/dynamic.xml
+.idea/**/uiDesigner.xml
+.idea/**/dbnavigator.xml
+
+# Gradle
+.idea/**/gradle.xml
+.idea/**/libraries
+
+# File-based project format
+*.iws
+
+# IntelliJ
+out/
+
+# JIRA plugin
+atlassian-ide-plugin.xml
+
+# Python #
+*.py[cod]
+*$py.class
+
+# Distribution / packaging
+.Python build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+wheels/
+*.whl
+*.egg-info/
+.installed.cfg
+*.egg
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.coverage
+.coverage.*
+.cache
+.pytest_cache/
+nosetests.xml
+coverage.xml
+*.cover
+.hypothesis/
+
+# Jupyter Notebook
+.ipynb_checkpoints
+
+# pyenv
+.python-version
+
+# celery
+celerybeat-schedule.*
+
+# SageMath parsed files
+*.sage.py
+
+# Environments
+.env
+.venv
+env/
+venv/
+ENV/
+env.bak/
+venv.bak/
+
+# mkdocs documentation
+/site
+
+# mypy
+.mypy_cache/
+
+# Sublime Text #
+*.tmlanguage.cache
+*.tmPreferences.cache
+*.stTheme.cache
+*.sublime-workspace
+*.sublime-project
+
+# sftp configuration file
+sftp-config.json
+
+# Package control specific files Package
+Control.last-run
+Control.ca-list
+Control.ca-bundle
+Control.system-ca-bundle
+GitHub.sublime-settings
+
+# Visual Studio Code #
+.vscode/*
+!.vscode/settings.json
+!.vscode/tasks.json
+!.vscode/launch.json
+!.vscode/extensions.json
+.history
+.ruff_cache
\ No newline at end of file
diff --git a/.pylintrc b/.pylintrc
new file mode 100644
index 0000000..b4daaec
--- /dev/null
+++ b/.pylintrc
@@ -0,0 +1,16 @@
+[MASTER]
+ignore=migrations, manage.py
+max-line-length=120
+
+[MESSAGES CONTROL]
+
+# Enable the message, report, category or checker with the given id(s). You can
+# either give multiple identifier separated by comma (,) or put this option
+# multiple time.
+#enable=
+
+# Disable the message, report, category or checker with the given id(s). You
+# can either give multiple identifier separated by comma (,) or put this option
+# multiple time (only on the command line, not in the configuration file where
+# it should appear only once).
+disable=too-few-public-methods, no-member, protected-access
\ No newline at end of file
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..c5ba02e
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,4 @@
+include *.rst
+include LICENSE
+include django_country_kit/locale
+exclude tox.ini
diff --git a/Pipfile b/Pipfile
new file mode 100644
index 0000000..0735901
--- /dev/null
+++ b/Pipfile
@@ -0,0 +1,17 @@
+[[source]]
+url = "https://pypi.org/simple"
+verify_ssl = true
+name = "pypi"
+
+[packages]
+django = ">=3.2"
+
+[dev-packages]
+django-extensions = "~=3.2.3"
+pylint = "*"
+flake8 = "*"
+isort = "*"
+ruff = "*"
+
+[requires]
+python_version = "3.10"
\ No newline at end of file
diff --git a/Pipfile.lock b/Pipfile.lock
new file mode 100644
index 0000000..25d942c
--- /dev/null
+++ b/Pipfile.lock
@@ -0,0 +1,205 @@
+{
+ "_meta": {
+ "hash": {
+ "sha256": "d7d33a1bb21e7774db24a4cfd1420dd5195c0da2c9f14a4afff94a68d448d59b"
+ },
+ "pipfile-spec": 6,
+ "requires": {
+ "python_version": "3.10"
+ },
+ "sources": [
+ {
+ "name": "pypi",
+ "url": "https://pypi.org/simple",
+ "verify_ssl": true
+ }
+ ]
+ },
+ "default": {
+ "asgiref": {
+ "hashes": [
+ "sha256:89b2ef2247e3b562a16eef663bc0e2e703ec6468e2fa8a5cd61cd449786d4f6e",
+ "sha256:9e0ce3aa93a819ba5b45120216b23878cf6e8525eb3848653452b4192b92afed"
+ ],
+ "markers": "python_version >= '3.7'",
+ "version": "==3.7.2"
+ },
+ "django": {
+ "hashes": [
+ "sha256:8c8659665bc6e3a44fefe1ab0a291e5a3fb3979f9a8230be29de975e57e8f854",
+ "sha256:f47a37a90b9bbe2c8ec360235192c7fddfdc832206fcf618bb849b39256affc1"
+ ],
+ "index": "pypi",
+ "version": "==5.0.1"
+ },
+ "sqlparse": {
+ "hashes": [
+ "sha256:5430a4fe2ac7d0f93e66f1efc6e1338a41884b7ddf2a350cedd20ccc4d9d28f3",
+ "sha256:d446183e84b8349fa3061f0fe7f06ca94ba65b426946ffebe6e3e8295332420c"
+ ],
+ "markers": "python_version >= '3.5'",
+ "version": "==0.4.4"
+ },
+ "typing-extensions": {
+ "hashes": [
+ "sha256:23478f88c37f27d76ac8aee6c905017a143b0b1b886c3c9f66bc2fd94f9f5783",
+ "sha256:af72aea155e91adfc61c3ae9e0e342dbc0cba726d6cba4b6c72c1f34e47291cd"
+ ],
+ "markers": "python_version < '3.11'",
+ "version": "==4.9.0"
+ }
+ },
+ "develop": {
+ "asgiref": {
+ "hashes": [
+ "sha256:89b2ef2247e3b562a16eef663bc0e2e703ec6468e2fa8a5cd61cd449786d4f6e",
+ "sha256:9e0ce3aa93a819ba5b45120216b23878cf6e8525eb3848653452b4192b92afed"
+ ],
+ "markers": "python_version >= '3.7'",
+ "version": "==3.7.2"
+ },
+ "astroid": {
+ "hashes": [
+ "sha256:4a61cf0a59097c7bb52689b0fd63717cd2a8a14dc9f1eee97b82d814881c8c91",
+ "sha256:d6e62862355f60e716164082d6b4b041d38e2a8cf1c7cd953ded5108bac8ff5c"
+ ],
+ "markers": "python_full_version >= '3.8.0'",
+ "version": "==3.0.2"
+ },
+ "dill": {
+ "hashes": [
+ "sha256:76b122c08ef4ce2eedcd4d1abd8e641114bfc6c2867f49f3c41facf65bf19f5e",
+ "sha256:cc1c8b182eb3013e24bd475ff2e9295af86c1a38eb1aff128dac8962a9ce3c03"
+ ],
+ "markers": "python_version < '3.11'",
+ "version": "==0.3.7"
+ },
+ "django": {
+ "hashes": [
+ "sha256:8c8659665bc6e3a44fefe1ab0a291e5a3fb3979f9a8230be29de975e57e8f854",
+ "sha256:f47a37a90b9bbe2c8ec360235192c7fddfdc832206fcf618bb849b39256affc1"
+ ],
+ "index": "pypi",
+ "version": "==5.0.1"
+ },
+ "django-extensions": {
+ "hashes": [
+ "sha256:44d27919d04e23b3f40231c4ab7af4e61ce832ef46d610cc650d53e68328410a",
+ "sha256:9600b7562f79a92cbf1fde6403c04fee314608fefbb595502e34383ae8203401"
+ ],
+ "index": "pypi",
+ "version": "==3.2.3"
+ },
+ "flake8": {
+ "hashes": [
+ "sha256:33f96621059e65eec474169085dc92bf26e7b2d47366b70be2f67ab80dc25132",
+ "sha256:a6dfbb75e03252917f2473ea9653f7cd799c3064e54d4c8140044c5c065f53c3"
+ ],
+ "index": "pypi",
+ "version": "==7.0.0"
+ },
+ "isort": {
+ "hashes": [
+ "sha256:48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109",
+ "sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6"
+ ],
+ "index": "pypi",
+ "version": "==5.13.2"
+ },
+ "mccabe": {
+ "hashes": [
+ "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325",
+ "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"
+ ],
+ "markers": "python_version >= '3.6'",
+ "version": "==0.7.0"
+ },
+ "platformdirs": {
+ "hashes": [
+ "sha256:11c8f37bcca40db96d8144522d925583bdb7a31f7b0e37e3ed4318400a8e2380",
+ "sha256:906d548203468492d432bcb294d4bc2fff751bf84971fbb2c10918cc206ee420"
+ ],
+ "markers": "python_version >= '3.8'",
+ "version": "==4.1.0"
+ },
+ "pycodestyle": {
+ "hashes": [
+ "sha256:41ba0e7afc9752dfb53ced5489e89f8186be00e599e712660695b7a75ff2663f",
+ "sha256:44fe31000b2d866f2e41841b18528a505fbd7fef9017b04eff4e2648a0fadc67"
+ ],
+ "markers": "python_version >= '3.8'",
+ "version": "==2.11.1"
+ },
+ "pyflakes": {
+ "hashes": [
+ "sha256:1c61603ff154621fb2a9172037d84dca3500def8c8b630657d1701f026f8af3f",
+ "sha256:84b5be138a2dfbb40689ca07e2152deb896a65c3a3e24c251c5c62489568074a"
+ ],
+ "markers": "python_version >= '3.8'",
+ "version": "==3.2.0"
+ },
+ "pylint": {
+ "hashes": [
+ "sha256:58c2398b0301e049609a8429789ec6edf3aabe9b6c5fec916acd18639c16de8b",
+ "sha256:7a1585285aefc5165db81083c3e06363a27448f6b467b3b0f30dbd0ac1f73810"
+ ],
+ "index": "pypi",
+ "version": "==3.0.3"
+ },
+ "ruff": {
+ "hashes": [
+ "sha256:1c8eca1a47b4150dc0fbec7fe68fc91c695aed798532a18dbb1424e61e9b721f",
+ "sha256:2270504d629a0b064247983cbc495bed277f372fb9eaba41e5cf51f7ba705a6a",
+ "sha256:269302b31ade4cde6cf6f9dd58ea593773a37ed3f7b97e793c8594b262466b67",
+ "sha256:62ce2ae46303ee896fc6811f63d6dabf8d9c389da0f3e3f2bce8bc7f15ef5488",
+ "sha256:653230dd00aaf449eb5ff25d10a6e03bc3006813e2cb99799e568f55482e5cae",
+ "sha256:6b3dadc9522d0eccc060699a9816e8127b27addbb4697fc0c08611e4e6aeb8b5",
+ "sha256:7060156ecc572b8f984fd20fd8b0fcb692dd5d837b7606e968334ab7ff0090ab",
+ "sha256:722bafc299145575a63bbd6b5069cb643eaa62546a5b6398f82b3e4403329cab",
+ "sha256:80258bb3b8909b1700610dfabef7876423eed1bc930fe177c71c414921898efa",
+ "sha256:87b3acc6c4e6928459ba9eb7459dd4f0c4bf266a053c863d72a44c33246bfdbf",
+ "sha256:96f76536df9b26622755c12ed8680f159817be2f725c17ed9305b472a757cdbb",
+ "sha256:a53d8e35313d7b67eb3db15a66c08434809107659226a90dcd7acb2afa55faea",
+ "sha256:ab3f71f64498c7241123bb5a768544cf42821d2a537f894b22457a543d3ca7a9",
+ "sha256:ad3f8088b2dfd884820289a06ab718cde7d38b94972212cc4ba90d5fbc9955f3",
+ "sha256:b2027dde79d217b211d725fc833e8965dc90a16d0d3213f1298f97465956661b",
+ "sha256:bea9be712b8f5b4ebed40e1949379cfb2a7d907f42921cf9ab3aae07e6fba9eb",
+ "sha256:e3d241aa61f92b0805a7082bd89a9990826448e4d0398f0e2bc8f05c75c63d99"
+ ],
+ "index": "pypi",
+ "version": "==0.1.14"
+ },
+ "sqlparse": {
+ "hashes": [
+ "sha256:5430a4fe2ac7d0f93e66f1efc6e1338a41884b7ddf2a350cedd20ccc4d9d28f3",
+ "sha256:d446183e84b8349fa3061f0fe7f06ca94ba65b426946ffebe6e3e8295332420c"
+ ],
+ "markers": "python_version >= '3.5'",
+ "version": "==0.4.4"
+ },
+ "tomli": {
+ "hashes": [
+ "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc",
+ "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"
+ ],
+ "markers": "python_version < '3.11'",
+ "version": "==2.0.1"
+ },
+ "tomlkit": {
+ "hashes": [
+ "sha256:75baf5012d06501f07bee5bf8e801b9f343e7aac5a92581f20f80ce632e6b5a4",
+ "sha256:b0a645a9156dc7cb5d3a1f0d4bab66db287fcb8e0430bdd4664a095ea16414ba"
+ ],
+ "markers": "python_version >= '3.7'",
+ "version": "==0.12.3"
+ },
+ "typing-extensions": {
+ "hashes": [
+ "sha256:23478f88c37f27d76ac8aee6c905017a143b0b1b886c3c9f66bc2fd94f9f5783",
+ "sha256:af72aea155e91adfc61c3ae9e0e342dbc0cba726d6cba4b6c72c1f34e47291cd"
+ ],
+ "markers": "python_version < '3.11'",
+ "version": "==4.9.0"
+ }
+ }
+}
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..6617731
--- /dev/null
+++ b/README.md
@@ -0,0 +1,75 @@
+# Django Country Kit
+
+Django Country Kit is a Django app that provides country-related functionality, including a custom model field for storing country codes, a form widget for selecting countries, and associated tests.
+
+## Features
+
+- **Country Model Field:** Easily store and retrieve country codes in your Django models.
+- **Country Widget:** A form widget for rendering a dropdown list of countries in your Django forms.
+- **Tested:** Comprehensive tests for ensuring the functionality of the provided components.
+
+## Installation
+
+1. Install Django Country Kit using pip:
+
+ ```bash
+ pip install django-country-kit
+ ```
+
+2. Add `'django_country_kit'` to your `INSTALLED_APPS` in your Django project's settings:
+
+ ```python
+ INSTALLED_APPS = [
+ # ...
+ 'django_country_kit',
+ # ...
+ ]
+ ```
+
+3. Run migrations to create the necessary database tables:
+
+ ```bash
+ python manage.py migrate
+ ```
+
+4. Run collectstatic:
+
+ ```bash
+ python manage.py collectstatic
+ ```
+
+
+## Usage
+
+### Country Model Field
+
+In your models, use the `CountryField` to store country codes:
+
+```python
+from django.db import models
+from django_country_kit.fields import CountryField
+
+class YourModel(models.Model):
+ country = CountryField()
+```
+
+### Country Widget
+
+In your forms, use the `CountryWidget` to render a dropdown list of countries:
+
+```python
+from django import forms
+from django_country_kit.widgets import CountryWidget
+
+class YourForm(forms.Form):
+ country = forms.CharField(widget=CountryWidget())
+```
+
+### Custom settings
+
+Django Country Kit provides custom settings for further customization of country data:
+
+- `OVERRIDE_COUNTRIES`: Allows users to override specific countries with custom data.
+- `EXCLUDE_COUNTRIES`: Allows users to exclude specific countries from the available choices.
+
+You can customize these settings in your Django project's settings file to tailor the country data according to your needs.
diff --git a/dev/__init__.py b/dev/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/dev/admin.py b/dev/admin.py
new file mode 100644
index 0000000..1fd9841
--- /dev/null
+++ b/dev/admin.py
@@ -0,0 +1,27 @@
+"""
+Django admin configuration for managing ExampleModel.
+
+This file contains the necessary configuration to register the ExampleModel
+with the Django admin interface. It uses the 'admin.site.register' function to
+make the model accessible and manageable through the Django admin site.
+
+Usage:
+- Import this module in your Django project.
+- Make sure 'ExampleModel' is defined in the '.models' module of the same app.
+
+Example:
+ # Import the admin module in your Django project's admin.py file.
+ from django.contrib import admin
+
+ # Import the ExampleModel from the same app's models module.
+ from .models import ExampleModel
+
+ # Register the ExampleModel with the Django admin site.
+ admin.site.register(ExampleModel)
+"""
+from django.contrib import admin
+
+from .models import ExampleModel
+
+# Register your models here.
+admin.site.register(ExampleModel)
diff --git a/dev/apps.py b/dev/apps.py
new file mode 100644
index 0000000..71c5530
--- /dev/null
+++ b/dev/apps.py
@@ -0,0 +1,42 @@
+"""
+Django AppConfig for the 'dev' app.
+
+This AppConfig class defines configuration settings for the 'dev' app in a Django project.
+It sets the default_auto_field to 'django.db.models.BigAutoField', which is the default
+AutoField for models in Django 3.2 and later versions.
+
+Usage:
+- Include the name of this AppConfig class in the 'INSTALLED_APPS' list of your Django project's settings.
+
+Example:
+ # In your Django project's settings.py file:
+ INSTALLED_APPS = [
+ # ... other apps
+ 'dev.apps.DevConfig', # Include the AppConfig class
+ ]
+
+Attributes:
+ - default_auto_field (str): The default AutoField to use for model fields.
+ - name (str): The name of the app.
+
+Note:
+ This AppConfig class is automatically generated when you create a new app using the
+ 'python manage.py startapp' command in Django.
+
+For more information, see Django documentation on AppConfig:
+https://docs.djangoproject.com/en/5.0/ref/applications/#configuring-applications
+"""
+
+from django.apps import AppConfig
+
+
+class DevConfig(AppConfig):
+ """
+ AppConfig class for the 'dev' app.
+
+ Attributes:
+ - default_auto_field (str): The default AutoField to use for model fields.
+ - name (str): The name of the app.
+ """
+ default_auto_field = "django.db.models.BigAutoField"
+ name = "dev"
diff --git a/dev/migrations/0001_initial.py b/dev/migrations/0001_initial.py
new file mode 100644
index 0000000..5983aab
--- /dev/null
+++ b/dev/migrations/0001_initial.py
@@ -0,0 +1,533 @@
+# Generated by Django 5.0.1 on 2024-01-29 14:22
+
+from django.db import migrations, models
+
+import django_country_kit.fields
+
+
+class Migration(migrations.Migration):
+ initial = True
+
+ dependencies = []
+
+ operations = [
+ migrations.CreateModel(
+ name="ExampleModel",
+ fields=[
+ (
+ "id",
+ models.BigAutoField(
+ auto_created=True,
+ primary_key=True,
+ serialize=False,
+ verbose_name="ID",
+ ),
+ ),
+ ("name", models.CharField(max_length=255)),
+ (
+ "multiple_country",
+ django_country_kit.fields.CountryField(
+ choices=[
+ ("AF", "Afghanistan"),
+ ("AX", "Åland Islands"),
+ ("AL", "Albania"),
+ ("DZ", "Algeria"),
+ ("AS", "American Samoa"),
+ ("AD", "Andorra"),
+ ("AO", "Angola"),
+ ("AI", "Anguilla"),
+ ("AQ", "Antarctica"),
+ ("AG", "Antigua and Barbuda"),
+ ("AR", "Argentina"),
+ ("AM", "Armenia"),
+ ("AW", "Aruba"),
+ ("AU", "Australia"),
+ ("AT", "Austria"),
+ ("AZ", "Azerbaijan"),
+ ("BS", "Bahamas"),
+ ("BH", "Bahrain"),
+ ("BD", "Bangladesh"),
+ ("BB", "Barbados"),
+ ("BY", "Belarus"),
+ ("BE", "Belgium"),
+ ("BZ", "Belize"),
+ ("BJ", "Benin"),
+ ("BM", "Bermuda"),
+ ("BT", "Bhutan"),
+ ("BO", "Bolivia"),
+ ("BA", "Bosnia and Herzegovina"),
+ ("BW", "Botswana"),
+ ("BV", "Bouvet Island"),
+ ("BR", "Brazil"),
+ ("IO", "British Indian Ocean Territory"),
+ ("BN", "Brunei Darussalam"),
+ ("BG", "Bulgaria"),
+ ("BF", "Burkina Faso"),
+ ("BI", "Burundi"),
+ ("KH", "Cambodia"),
+ ("CM", "Cameroon"),
+ ("CA", "Canada"),
+ ("CV", "Cape Verde"),
+ ("KY", "Cayman Islands"),
+ ("CF", "Central African Republic"),
+ ("TD", "Chad"),
+ ("CL", "Chile"),
+ ("CN", "China"),
+ ("CX", "Christmas Island"),
+ ("CC", "Cocos (Keeling) Islands"),
+ ("CO", "Colombia"),
+ ("KM", "Comoros"),
+ ("CG", "Congo"),
+ ("CD", "Congo, The Democratic Republic of the"),
+ ("CK", "Cook Islands"),
+ ("CR", "Costa Rica"),
+ ("CI", "Cote D'Ivoire"),
+ ("HR", "Croatia"),
+ ("CU", "Cuba"),
+ ("CY", "Cyprus"),
+ ("CZ", "Czech Republic"),
+ ("DK", "Denmark"),
+ ("DJ", "Djibouti"),
+ ("DM", "Dominica"),
+ ("DO", "Dominican Republic"),
+ ("EC", "Ecuador"),
+ ("EG", "Egypt"),
+ ("SV", "El Salvador"),
+ ("GQ", "Equatorial Guinea"),
+ ("ER", "Eritrea"),
+ ("EE", "Estonia"),
+ ("ET", "Ethiopia"),
+ ("FK", "Falkland Islands (Malvinas)"),
+ ("FO", "Faroe Islands"),
+ ("FJ", "Fiji"),
+ ("FI", "Finland"),
+ ("FR", "France"),
+ ("GF", "French Guiana"),
+ ("PF", "French Polynesia"),
+ ("TF", "French Southern Territories"),
+ ("GA", "Gabon"),
+ ("GM", "Gambia"),
+ ("GE", "Georgia"),
+ ("DE", "Germany"),
+ ("GH", "Ghana"),
+ ("GI", "Gibraltar"),
+ ("GR", "Greece"),
+ ("GL", "Greenland"),
+ ("GD", "Grenada"),
+ ("GP", "Guadeloupe"),
+ ("GU", "Guam"),
+ ("GT", "Guatemala"),
+ ("GG", "Guernsey"),
+ ("GN", "Guinea"),
+ ("GW", "Guinea-Bissau"),
+ ("GY", "Guyana"),
+ ("HT", "Haiti"),
+ ("HM", "Heard Island and Mcdonald Islands"),
+ ("VA", "Holy See (Vatican City State)"),
+ ("HN", "Honduras"),
+ ("HK", "Hong Kong"),
+ ("HU", "Hungary"),
+ ("IS", "Iceland"),
+ ("IN", "India"),
+ ("ID", "Indonesia"),
+ ("IR", "Iran, Islamic Republic Of"),
+ ("IQ", "Iraq"),
+ ("IE", "Ireland"),
+ ("IM", "Isle of Man"),
+ ("IL", "Israel"),
+ ("IT", "Italy"),
+ ("JM", "Jamaica"),
+ ("JP", "Japan"),
+ ("JE", "Jersey"),
+ ("JO", "Jordan"),
+ ("KZ", "Kazakhstan"),
+ ("KE", "Kenya"),
+ ("KI", "Kiribati"),
+ ("KP", "Korea, Democratic People's Republic of"),
+ ("KR", "Korea, Republic of"),
+ ("KW", "Kuwait"),
+ ("KG", "Kyrgyzstan"),
+ ("LA", "Lao People's Democratic Republic"),
+ ("LV", "Latvia"),
+ ("LB", "Lebanon"),
+ ("LS", "Lesotho"),
+ ("LR", "Liberia"),
+ ("LY", "Libyan Arab Jamahiriya"),
+ ("LI", "Liechtenstein"),
+ ("LT", "Lithuania"),
+ ("LU", "Luxembourg"),
+ ("MO", "Macao"),
+ ("MK", "Macedonia, The Former Yugoslav Republic of"),
+ ("MG", "Madagascar"),
+ ("MW", "Malawi"),
+ ("MY", "Malaysia"),
+ ("MV", "Maldives"),
+ ("ML", "Mali"),
+ ("MT", "Malta"),
+ ("MH", "Marshall Islands"),
+ ("MQ", "Martinique"),
+ ("MR", "Mauritania"),
+ ("MU", "Mauritius"),
+ ("YT", "Mayotte"),
+ ("MX", "Mexico"),
+ ("FM", "Micronesia, Federated States of"),
+ ("MD", "Moldova, Republic of"),
+ ("MC", "Monaco"),
+ ("MN", "Mongolia"),
+ ("MS", "Montserrat"),
+ ("MA", "Morocco"),
+ ("MZ", "Mozambique"),
+ ("MM", "Myanmar"),
+ ("NA", "Namibia"),
+ ("NR", "Nauru"),
+ ("NP", "Nepal"),
+ ("NL", "Netherlands"),
+ ("AN", "Netherlands Antilles"),
+ ("NC", "New Caledonia"),
+ ("NZ", "New Zealand"),
+ ("NI", "Nicaragua"),
+ ("NE", "Niger"),
+ ("NG", "Nigeria"),
+ ("NU", "Niue"),
+ ("NF", "Norfolk Island"),
+ ("MP", "Northern Mariana Islands"),
+ ("NO", "Norway"),
+ ("OM", "Oman"),
+ ("PK", "Pakistan"),
+ ("PW", "Palau"),
+ ("PS", "Palestinian Territory, Occupied"),
+ ("PA", "Panama"),
+ ("PG", "Papua New Guinea"),
+ ("PY", "Paraguay"),
+ ("PE", "Peru"),
+ ("PH", "Philippines"),
+ ("PN", "Pitcairn"),
+ ("PL", "Poland"),
+ ("PT", "Portugal"),
+ ("PR", "Puerto Rico"),
+ ("QA", "Qatar"),
+ ("RE", "Reunion"),
+ ("RO", "Romania"),
+ ("RU", "Russian Federation"),
+ ("RW", "Rwanda"),
+ ("SH", "Saint Helena"),
+ ("KN", "Saint Kitts and Nevis"),
+ ("LC", "Saint Lucia"),
+ ("PM", "Saint Pierre and Miquelon"),
+ ("VC", "Saint Vincent and the Grenadines"),
+ ("WS", "Samoa"),
+ ("SM", "San Marino"),
+ ("ST", "Sao Tome and Principe"),
+ ("SA", "Saudi Arabia"),
+ ("SN", "Senegal"),
+ ("CS", "Serbia and Montenegro"),
+ ("SC", "Seychelles"),
+ ("SL", "Sierra Leone"),
+ ("SG", "Singapore"),
+ ("SK", "Slovakia"),
+ ("SI", "Slovenia"),
+ ("SB", "Solomon Islands"),
+ ("SO", "Somalia"),
+ ("ZA", "South Africa"),
+ ("GS", "South Georgia and the South Sandwich Islands"),
+ ("ES", "Spain"),
+ ("LK", "Sri Lanka"),
+ ("SD", "Sudan"),
+ ("SR", "Suriname"),
+ ("SJ", "Svalbard and Jan Mayen"),
+ ("SZ", "Swaziland"),
+ ("SE", "Sweden"),
+ ("CH", "Switzerland"),
+ ("SY", "Syrian Arab Republic"),
+ ("TW", "Taiwan, Province of China"),
+ ("TJ", "Tajikistan"),
+ ("TZ", "Tanzania, United Republic of"),
+ ("TH", "Thailand"),
+ ("TL", "Timor-Leste"),
+ ("TG", "Togo"),
+ ("TK", "Tokelau"),
+ ("TO", "Tonga"),
+ ("TT", "Trinidad and Tobago"),
+ ("TN", "Tunisia"),
+ ("TR", "Türkiye"),
+ ("TM", "Turkmenistan"),
+ ("TC", "Turks and Caicos Islands"),
+ ("TV", "Tuvalu"),
+ ("UG", "Uganda"),
+ ("UA", "Ukraine"),
+ ("AE", "United Arab Emirates"),
+ ("GB", "United Kingdom"),
+ ("US", "United States"),
+ ("UM", "United States Minor Outlying Islands"),
+ ("UY", "Uruguay"),
+ ("UZ", "Uzbekistan"),
+ ("VU", "Vanuatu"),
+ ("VE", "Venezuela"),
+ ("VN", "Viet Nam"),
+ ("VG", "Virgin Islands, British"),
+ ("VI", "Virgin Islands, U.S."),
+ ("WF", "Wallis and Futuna"),
+ ("EH", "Western Sahara"),
+ ("YE", "Yemen"),
+ ("ZM", "Zambia"),
+ ("ZW", "Zimbabwe"),
+ ],
+ max_length=2,
+ ),
+ ),
+ (
+ "country",
+ django_country_kit.fields.CountryField(
+ blank=True,
+ choices=[
+ ("AF", "Afghanistan"),
+ ("AX", "Åland Islands"),
+ ("AL", "Albania"),
+ ("DZ", "Algeria"),
+ ("AS", "American Samoa"),
+ ("AD", "Andorra"),
+ ("AO", "Angola"),
+ ("AI", "Anguilla"),
+ ("AQ", "Antarctica"),
+ ("AG", "Antigua and Barbuda"),
+ ("AR", "Argentina"),
+ ("AM", "Armenia"),
+ ("AW", "Aruba"),
+ ("AU", "Australia"),
+ ("AT", "Austria"),
+ ("AZ", "Azerbaijan"),
+ ("BS", "Bahamas"),
+ ("BH", "Bahrain"),
+ ("BD", "Bangladesh"),
+ ("BB", "Barbados"),
+ ("BY", "Belarus"),
+ ("BE", "Belgium"),
+ ("BZ", "Belize"),
+ ("BJ", "Benin"),
+ ("BM", "Bermuda"),
+ ("BT", "Bhutan"),
+ ("BO", "Bolivia"),
+ ("BA", "Bosnia and Herzegovina"),
+ ("BW", "Botswana"),
+ ("BV", "Bouvet Island"),
+ ("BR", "Brazil"),
+ ("IO", "British Indian Ocean Territory"),
+ ("BN", "Brunei Darussalam"),
+ ("BG", "Bulgaria"),
+ ("BF", "Burkina Faso"),
+ ("BI", "Burundi"),
+ ("KH", "Cambodia"),
+ ("CM", "Cameroon"),
+ ("CA", "Canada"),
+ ("CV", "Cape Verde"),
+ ("KY", "Cayman Islands"),
+ ("CF", "Central African Republic"),
+ ("TD", "Chad"),
+ ("CL", "Chile"),
+ ("CN", "China"),
+ ("CX", "Christmas Island"),
+ ("CC", "Cocos (Keeling) Islands"),
+ ("CO", "Colombia"),
+ ("KM", "Comoros"),
+ ("CG", "Congo"),
+ ("CD", "Congo, The Democratic Republic of the"),
+ ("CK", "Cook Islands"),
+ ("CR", "Costa Rica"),
+ ("CI", "Cote D'Ivoire"),
+ ("HR", "Croatia"),
+ ("CU", "Cuba"),
+ ("CY", "Cyprus"),
+ ("CZ", "Czech Republic"),
+ ("DK", "Denmark"),
+ ("DJ", "Djibouti"),
+ ("DM", "Dominica"),
+ ("DO", "Dominican Republic"),
+ ("EC", "Ecuador"),
+ ("EG", "Egypt"),
+ ("SV", "El Salvador"),
+ ("GQ", "Equatorial Guinea"),
+ ("ER", "Eritrea"),
+ ("EE", "Estonia"),
+ ("ET", "Ethiopia"),
+ ("FK", "Falkland Islands (Malvinas)"),
+ ("FO", "Faroe Islands"),
+ ("FJ", "Fiji"),
+ ("FI", "Finland"),
+ ("FR", "France"),
+ ("GF", "French Guiana"),
+ ("PF", "French Polynesia"),
+ ("TF", "French Southern Territories"),
+ ("GA", "Gabon"),
+ ("GM", "Gambia"),
+ ("GE", "Georgia"),
+ ("DE", "Germany"),
+ ("GH", "Ghana"),
+ ("GI", "Gibraltar"),
+ ("GR", "Greece"),
+ ("GL", "Greenland"),
+ ("GD", "Grenada"),
+ ("GP", "Guadeloupe"),
+ ("GU", "Guam"),
+ ("GT", "Guatemala"),
+ ("GG", "Guernsey"),
+ ("GN", "Guinea"),
+ ("GW", "Guinea-Bissau"),
+ ("GY", "Guyana"),
+ ("HT", "Haiti"),
+ ("HM", "Heard Island and Mcdonald Islands"),
+ ("VA", "Holy See (Vatican City State)"),
+ ("HN", "Honduras"),
+ ("HK", "Hong Kong"),
+ ("HU", "Hungary"),
+ ("IS", "Iceland"),
+ ("IN", "India"),
+ ("ID", "Indonesia"),
+ ("IR", "Iran, Islamic Republic Of"),
+ ("IQ", "Iraq"),
+ ("IE", "Ireland"),
+ ("IM", "Isle of Man"),
+ ("IL", "Israel"),
+ ("IT", "Italy"),
+ ("JM", "Jamaica"),
+ ("JP", "Japan"),
+ ("JE", "Jersey"),
+ ("JO", "Jordan"),
+ ("KZ", "Kazakhstan"),
+ ("KE", "Kenya"),
+ ("KI", "Kiribati"),
+ ("KP", "Korea, Democratic People's Republic of"),
+ ("KR", "Korea, Republic of"),
+ ("KW", "Kuwait"),
+ ("KG", "Kyrgyzstan"),
+ ("LA", "Lao People's Democratic Republic"),
+ ("LV", "Latvia"),
+ ("LB", "Lebanon"),
+ ("LS", "Lesotho"),
+ ("LR", "Liberia"),
+ ("LY", "Libyan Arab Jamahiriya"),
+ ("LI", "Liechtenstein"),
+ ("LT", "Lithuania"),
+ ("LU", "Luxembourg"),
+ ("MO", "Macao"),
+ ("MK", "Macedonia, The Former Yugoslav Republic of"),
+ ("MG", "Madagascar"),
+ ("MW", "Malawi"),
+ ("MY", "Malaysia"),
+ ("MV", "Maldives"),
+ ("ML", "Mali"),
+ ("MT", "Malta"),
+ ("MH", "Marshall Islands"),
+ ("MQ", "Martinique"),
+ ("MR", "Mauritania"),
+ ("MU", "Mauritius"),
+ ("YT", "Mayotte"),
+ ("MX", "Mexico"),
+ ("FM", "Micronesia, Federated States of"),
+ ("MD", "Moldova, Republic of"),
+ ("MC", "Monaco"),
+ ("MN", "Mongolia"),
+ ("MS", "Montserrat"),
+ ("MA", "Morocco"),
+ ("MZ", "Mozambique"),
+ ("MM", "Myanmar"),
+ ("NA", "Namibia"),
+ ("NR", "Nauru"),
+ ("NP", "Nepal"),
+ ("NL", "Netherlands"),
+ ("AN", "Netherlands Antilles"),
+ ("NC", "New Caledonia"),
+ ("NZ", "New Zealand"),
+ ("NI", "Nicaragua"),
+ ("NE", "Niger"),
+ ("NG", "Nigeria"),
+ ("NU", "Niue"),
+ ("NF", "Norfolk Island"),
+ ("MP", "Northern Mariana Islands"),
+ ("NO", "Norway"),
+ ("OM", "Oman"),
+ ("PK", "Pakistan"),
+ ("PW", "Palau"),
+ ("PS", "Palestinian Territory, Occupied"),
+ ("PA", "Panama"),
+ ("PG", "Papua New Guinea"),
+ ("PY", "Paraguay"),
+ ("PE", "Peru"),
+ ("PH", "Philippines"),
+ ("PN", "Pitcairn"),
+ ("PL", "Poland"),
+ ("PT", "Portugal"),
+ ("PR", "Puerto Rico"),
+ ("QA", "Qatar"),
+ ("RE", "Reunion"),
+ ("RO", "Romania"),
+ ("RU", "Russian Federation"),
+ ("RW", "Rwanda"),
+ ("SH", "Saint Helena"),
+ ("KN", "Saint Kitts and Nevis"),
+ ("LC", "Saint Lucia"),
+ ("PM", "Saint Pierre and Miquelon"),
+ ("VC", "Saint Vincent and the Grenadines"),
+ ("WS", "Samoa"),
+ ("SM", "San Marino"),
+ ("ST", "Sao Tome and Principe"),
+ ("SA", "Saudi Arabia"),
+ ("SN", "Senegal"),
+ ("CS", "Serbia and Montenegro"),
+ ("SC", "Seychelles"),
+ ("SL", "Sierra Leone"),
+ ("SG", "Singapore"),
+ ("SK", "Slovakia"),
+ ("SI", "Slovenia"),
+ ("SB", "Solomon Islands"),
+ ("SO", "Somalia"),
+ ("ZA", "South Africa"),
+ ("GS", "South Georgia and the South Sandwich Islands"),
+ ("ES", "Spain"),
+ ("LK", "Sri Lanka"),
+ ("SD", "Sudan"),
+ ("SR", "Suriname"),
+ ("SJ", "Svalbard and Jan Mayen"),
+ ("SZ", "Swaziland"),
+ ("SE", "Sweden"),
+ ("CH", "Switzerland"),
+ ("SY", "Syrian Arab Republic"),
+ ("TW", "Taiwan, Province of China"),
+ ("TJ", "Tajikistan"),
+ ("TZ", "Tanzania, United Republic of"),
+ ("TH", "Thailand"),
+ ("TL", "Timor-Leste"),
+ ("TG", "Togo"),
+ ("TK", "Tokelau"),
+ ("TO", "Tonga"),
+ ("TT", "Trinidad and Tobago"),
+ ("TN", "Tunisia"),
+ ("TR", "Türkiye"),
+ ("TM", "Turkmenistan"),
+ ("TC", "Turks and Caicos Islands"),
+ ("TV", "Tuvalu"),
+ ("UG", "Uganda"),
+ ("UA", "Ukraine"),
+ ("AE", "United Arab Emirates"),
+ ("GB", "United Kingdom"),
+ ("US", "United States"),
+ ("UM", "United States Minor Outlying Islands"),
+ ("UY", "Uruguay"),
+ ("UZ", "Uzbekistan"),
+ ("VU", "Vanuatu"),
+ ("VE", "Venezuela"),
+ ("VN", "Viet Nam"),
+ ("VG", "Virgin Islands, British"),
+ ("VI", "Virgin Islands, U.S."),
+ ("WF", "Wallis and Futuna"),
+ ("EH", "Western Sahara"),
+ ("YE", "Yemen"),
+ ("ZM", "Zambia"),
+ ("ZW", "Zimbabwe"),
+ ],
+ max_length=2,
+ null=True,
+ ),
+ ),
+ ],
+ ),
+ ]
diff --git a/dev/migrations/__init__.py b/dev/migrations/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/dev/models.py b/dev/models.py
new file mode 100644
index 0000000..fb55c58
--- /dev/null
+++ b/dev/models.py
@@ -0,0 +1,60 @@
+"""
+Django Model for ExampleModel.
+
+This model represents an example entity in the database, with fields such as 'name'
+and 'country'. It utilizes the Django Country Kit's 'CountryField' for handling country
+information.
+
+Usage:
+- Include this model in your Django app's models.py file.
+- Make migrations and apply them to create the corresponding database table.
+
+Example:
+ # In your Django app's models.py file:
+ from django.db import models
+ from django_country_kit.fields import CountryField
+
+ class ExampleModel(models.Model):
+ name = models.CharField(max_length=255)
+ country = CountryField()
+
+ def __str__(self):
+ return self.name
+
+Attributes:
+ - name (CharField): A character field for storing the name of the entity.
+ - country (CountryField): A custom field from Django Country Kit for handling country information.
+
+Methods:
+ - __str__(): A method returning a string representation of the entity.
+
+Note:
+ Make sure to install the 'django-country-kit' package and include it in your project's
+ dependencies before using the 'CountryField'. You can install it using:
+ pip install django-country-kit
+
+For more information, see Django documentation on models:
+https://docs.djangoproject.com/en/5.0/topics/db/models/
+"""
+from django.db import models
+
+from django_country_kit.fields import CountryField
+
+
+class ExampleModel(models.Model):
+ """
+ Django Model for ExampleModel.
+
+ Attributes:
+ - name (CharField): A character field for storing the name of the entity.
+ - country (CountryField): A custom field from Django Country Kit for handling country information.
+ """
+ name = models.CharField(max_length=255)
+ multiple_country = CountryField(multiple=True)
+ country = CountryField(blank=True, null=True)
+
+ def __str__(self):
+ """
+ Return a string representation of the entity.
+ """
+ return str(self.name)
diff --git a/dev/templates/dev/index.html b/dev/templates/dev/index.html
new file mode 100644
index 0000000..b1ca026
--- /dev/null
+++ b/dev/templates/dev/index.html
@@ -0,0 +1,15 @@
+
+
+
+
+
+ Example page
+
+
+
+
+
diff --git a/dev/views.py b/dev/views.py
new file mode 100644
index 0000000..cd34f3f
--- /dev/null
+++ b/dev/views.py
@@ -0,0 +1,86 @@
+"""
+Django Form and View for ExampleForm.
+
+This module contains a Django Form class 'ExampleForm' and a view 'index'. The form includes
+a custom 'country' field using Django Country Kit's 'CountryWidget' for handling country
+information in the frontend.
+
+Usage:
+- Include this module in your Django app's forms.py and views.py files.
+- Use the 'ExampleForm' in your views to render and process the form.
+
+Example:
+ # In your Django app's forms.py file:
+ from django import forms
+ from django_country_kit.widgets import CountryWidget
+
+ class ExampleForm(forms.ModelForm):
+ country = forms.ChoiceField(
+ label='Your country',
+ widget=CountryWidget(attrs={'class': 'form-control'}),
+ )
+
+ class Meta:
+ fields = ('name', 'country')
+
+ # In your Django app's views.py file:
+ from django.shortcuts import render
+ from .forms import ExampleForm
+
+ def index(request):
+ return render(request, 'dev/index.html', {"form": ExampleForm()})
+
+Attributes:
+ - ExampleForm (ModelForm): A Django ModelForm class representing the 'ExampleModel'.
+ - index (function): A view function rendering the 'ExampleForm' in the 'dev/index.html' template.
+
+Note:
+ Make sure to include the 'CountryWidget' and 'ExampleForm' in your project's dependencies,
+ and create the 'ExampleModel' model before using the 'ExampleForm'.
+
+For more information, see Django documentation on forms and views:
+https://docs.djangoproject.com/en/5/topics/forms/
+https://docs.djangoproject.com/en/5/topics/http/views/
+"""
+
+from django import forms
+from django.shortcuts import render
+
+from django_country_kit.fields import CountryField
+
+from .models import ExampleModel
+
+
+class ExampleForm(forms.ModelForm):
+ """
+ Django ModelForm class for ExampleForm.
+
+ Attributes:
+ - country (ChoiceField): A choice field using 'CountryWidget' for handling country information.
+ """
+ country = CountryField().formfield()
+ multiple_country = CountryField(multiple=True).formfield()
+
+ class Meta:
+ """Meta class for ExampleForm."""
+ fields = ('name', 'multiple_country')
+ model = ExampleModel
+
+
+def index(request):
+ """
+ View function rendering the 'ExampleForm' in the 'dev/index.html' template.
+
+ Parameters:
+ - request (HttpRequest): The request object.
+
+ Returns:
+ - HttpResponse: The rendered response containing the 'ExampleForm'.
+ """
+ if request.method == 'POST':
+ form = ExampleForm(request.POST)
+ if form.is_valid():
+ form.save()
+ else:
+ form = ExampleForm()
+ return render(request, 'dev/index.html', {"form": form})
diff --git a/django_country_kit/__init__.py b/django_country_kit/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/django_country_kit/base.py b/django_country_kit/base.py
new file mode 100644
index 0000000..a477081
--- /dev/null
+++ b/django_country_kit/base.py
@@ -0,0 +1,59 @@
+"""
+Module defining a Country class with internationalization support.
+
+This module defines the 'Country' class, which represents a country with properties
+for accessing its name and alpha3 code. It utilizes the 'get_countries' function
+from the 'data' module to fetch country data.
+
+Usage:
+- Include this module in your Django app.
+
+Example:
+ # In your Django app's code:
+ from .data import get_countries
+
+ country = Country(code='US', custom_countries=get_countries())
+
+Attributes:
+ - Country (class): A class representing a country with properties for accessing its name and alpha3 code.
+"""
+from .data import get_countries
+
+
+class Country:
+ """
+ A class representing a country with properties for accessing its name and alpha3 code.
+
+ Attributes:
+ - _countries_data (dict): A dictionary containing information about various countries.
+ - _code (str): The country code.
+ """
+
+ def __init__(self, code=None, custom_countries=None):
+ """
+ Initialize a Country instance.
+
+ Args:
+ code (str): The country code.
+ custom_countries (dict): Custom country data to use instead of fetching from get_countries().
+ """
+ if custom_countries:
+ self._countries_data = custom_countries
+ else:
+ self._countries_data = get_countries()
+ self._code = code
+
+ @property
+ def countries_data(self):
+ """Get the 'COUNTRIES' data."""
+ return self._countries_data
+
+ @property
+ def name(self) -> str:
+ """Get the name of the country."""
+ return self._countries_data.get(self._code, {}).get('name', '')
+
+ @property
+ def alpha3(self) -> str:
+ """Get the alpha3 code of the country."""
+ return self._countries_data.get(self._code, {}).get('alpha3', '')
diff --git a/django_country_kit/data.py b/django_country_kit/data.py
new file mode 100644
index 0000000..3c3be67
--- /dev/null
+++ b/django_country_kit/data.py
@@ -0,0 +1,296 @@
+"""
+Module defining a dictionary of countries with internationalization support.
+
+This module defines the 'COUNTRIES' dictionary, which contains information about various countries.
+It utilizes Django's 'gettext_lazy' for internationalization of country names.
+
+Usage:
+- Include this module in your Django app.
+- Access country information using the 'COUNTRIES' dictionary.
+
+Example:
+ # In your Django app's code:
+ from .countries import COUNTRIES
+
+ country_name = COUNTRIES["AF"]["name"] # Access the name of Afghanistan with internationalization support.
+
+Attributes:
+ - COUNTRIES (dict): A dictionary containing information about various countries.
+ Each entry has a country code as the key, and a dictionary with 'name' and 'alpha3' as the values.
+
+Note:
+ The country names in the 'COUNTRIES' dictionary are wrapped with Django's 'gettext_lazy' for internationalization.
+ Make sure to include this module in your project and set up internationalization in your Django app.
+
+For more information, see Django documentation on internationalization:
+https://docs.djangoproject.com/en/5.0/topics/i18n/
+"""
+
+from django.conf import settings
+from django.utils.translation import gettext_lazy as _
+
+DATA = {
+ "AF": {"name": _("Afghanistan"), "alpha3": "AFG"},
+ "AX": {"name": _("Åland Islands"), "alpha3": "ALA"},
+ "AL": {"name": _("Albania"), "alpha3": "ALB"},
+ "DZ": {"name": _("Algeria"), "alpha3": "DZA"},
+ "AS": {"name": _("American Samoa"), "alpha3": "ASM"},
+ "AD": {"name": _("Andorra"), "alpha3": "AND"},
+ "AO": {"name": _("Angola"), "alpha3": "AGO"},
+ "AI": {"name": _("Anguilla"), "alpha3": "AIA"},
+ "AQ": {"name": _("Antarctica"), "alpha3": "ATA"},
+ "AG": {"name": _("Antigua and Barbuda"), "alpha3": "ATG"},
+ "AR": {"name": _("Argentina"), "alpha3": "ARG"},
+ "AM": {"name": _("Armenia"), "alpha3": "ARM"},
+ "AW": {"name": _("Aruba"), "alpha3": "ABW"},
+ "AU": {"name": _("Australia"), "alpha3": "AUS"},
+ "AT": {"name": _("Austria"), "alpha3": "AUT"},
+ "AZ": {"name": _("Azerbaijan"), "alpha3": "AZE"},
+ "BS": {"name": _("Bahamas"), "alpha3": "BHS"},
+ "BH": {"name": _("Bahrain"), "alpha3": "BHR"},
+ "BD": {"name": _("Bangladesh"), "alpha3": "BGD"},
+ "BB": {"name": _("Barbados"), "alpha3": "BRB"},
+ "BY": {"name": _("Belarus"), "alpha3": "BLR"},
+ "BE": {"name": _("Belgium"), "alpha3": "BEL"},
+ "BZ": {"name": _("Belize"), "alpha3": "BLZ"},
+ "BJ": {"name": _("Benin"), "alpha3": "BEN"},
+ "BM": {"name": _("Bermuda"), "alpha3": "BMU"},
+ "BT": {"name": _("Bhutan"), "alpha3": "BTN"},
+ "BO": {"name": _("Bolivia"), "alpha3": "BOL"},
+ "BA": {"name": _("Bosnia and Herzegovina"), "alpha3": "BIH"},
+ "BW": {"name": _("Botswana"), "alpha3": "BWA"},
+ "BV": {"name": _("Bouvet Island"), "alpha3": "BVT"},
+ "BR": {"name": _("Brazil"), "alpha3": "BRA"},
+ "IO": {"name": _("British Indian Ocean Territory"), "alpha3": "IOT"},
+ "BN": {"name": _("Brunei Darussalam"), "alpha3": "BRN"},
+ "BG": {"name": _("Bulgaria"), "alpha3": "BGR"},
+ "BF": {"name": _("Burkina Faso"), "alpha3": "BFA"},
+ "BI": {"name": _("Burundi"), "alpha3": "BDI"},
+ "KH": {"name": _("Cambodia"), "alpha3": "KHM"},
+ "CM": {"name": _("Cameroon"), "alpha3": "CMR"},
+ "CA": {"name": _("Canada"), "alpha3": "CAN"},
+ "CV": {"name": _("Cape Verde"), "alpha3": "CPV"},
+ "KY": {"name": _("Cayman Islands"), "alpha3": "CYM"},
+ "CF": {"name": _("Central African Republic"), "alpha3": "CAF"},
+ "TD": {"name": _("Chad"), "alpha3": "TCD"},
+ "CL": {"name": _("Chile"), "alpha3": "CHL"},
+ "CN": {"name": _("China"), "alpha3": "CHN"},
+ "CX": {"name": _("Christmas Island"), "alpha3": "CXR"},
+ "CC": {"name": _("Cocos (Keeling) Islands"), "alpha3": "CCK"},
+ "CO": {"name": _("Colombia"), "alpha3": "COL"},
+ "KM": {"name": _("Comoros"), "alpha3": "COM"},
+ "CG": {"name": _("Congo"), "alpha3": "COG"},
+ "CD": {"name": _("Congo, The Democratic Republic of the"), "alpha3": "COD"},
+ "CK": {"name": _("Cook Islands"), "alpha3": "COK"},
+ "CR": {"name": _("Costa Rica"), "alpha3": "CRI"},
+ "CI": {"name": _("Cote D'Ivoire"), "alpha3": "CIV"},
+ "HR": {"name": _("Croatia"), "alpha3": "HRV"},
+ "CU": {"name": _("Cuba"), "alpha3": "CUB"},
+ "CY": {"name": _("Cyprus"), "alpha3": "CYP"},
+ "CZ": {"name": _("Czech Republic"), "alpha3": "CZE"},
+ "DK": {"name": _("Denmark"), "alpha3": "DNK"},
+ "DJ": {"name": _("Djibouti"), "alpha3": "DJI"},
+ "DM": {"name": _("Dominica"), "alpha3": "DMA"},
+ "DO": {"name": _("Dominican Republic"), "alpha3": "DOM"},
+ "EC": {"name": _("Ecuador"), "alpha3": "ECU"},
+ "EG": {"name": _("Egypt"), "alpha3": "EGY"},
+ "SV": {"name": _("El Salvador"), "alpha3": "SLV"},
+ "GQ": {"name": _("Equatorial Guinea"), "alpha3": "GNQ"},
+ "ER": {"name": _("Eritrea"), "alpha3": "ERI"},
+ "EE": {"name": _("Estonia"), "alpha3": "EST"},
+ "ET": {"name": _("Ethiopia"), "alpha3": "ETH"},
+ "FK": {"name": _("Falkland Islands (Malvinas)"), "alpha3": "FLK"},
+ "FO": {"name": _("Faroe Islands"), "alpha3": "FRO"},
+ "FJ": {"name": _("Fiji"), "alpha3": "FJI"},
+ "FI": {"name": _("Finland"), "alpha3": "FIN"},
+ "FR": {"name": _("France"), "alpha3": "FRA"},
+ "GF": {"name": _("French Guiana"), "alpha3": "GUF"},
+ "PF": {"name": _("French Polynesia"), "alpha3": "PYF"},
+ "TF": {"name": _("French Southern Territories"), "alpha3": "ATF"},
+ "GA": {"name": _("Gabon"), "alpha3": "GAB"},
+ "GM": {"name": _("Gambia"), "alpha3": "GMB"},
+ "GE": {"name": _("Georgia"), "alpha3": "GEO"},
+ "DE": {"name": _("Germany"), "alpha3": "DEU"},
+ "GH": {"name": _("Ghana"), "alpha3": "GHA"},
+ "GI": {"name": _("Gibraltar"), "alpha3": "GIB"},
+ "GR": {"name": _("Greece"), "alpha3": "GRC"},
+ "GL": {"name": _("Greenland"), "alpha3": "GRL"},
+ "GD": {"name": _("Grenada"), "alpha3": "GRD"},
+ "GP": {"name": _("Guadeloupe"), "alpha3": "GLP"},
+ "GU": {"name": _("Guam"), "alpha3": "GUM"},
+ "GT": {"name": _("Guatemala"), "alpha3": "GTM"},
+ "GG": {"name": _("Guernsey"), "alpha3": "GGY"},
+ "GN": {"name": _("Guinea"), "alpha3": "GIN"},
+ "GW": {"name": _("Guinea-Bissau"), "alpha3": "GNB"},
+ "GY": {"name": _("Guyana"), "alpha3": "GUY"},
+ "HT": {"name": _("Haiti"), "alpha3": "HTI"},
+ "HM": {"name": _("Heard Island and Mcdonald Islands"), "alpha3": "HMD"},
+ "VA": {"name": _("Holy See (Vatican City State)"), "alpha3": "VAT"},
+ "HN": {"name": _("Honduras"), "alpha3": "HND"},
+ "HK": {"name": _("Hong Kong"), "alpha3": "HKG"},
+ "HU": {"name": _("Hungary"), "alpha3": "HUN"},
+ "IS": {"name": _("Iceland"), "alpha3": "ISL"},
+ "IN": {"name": _("India"), "alpha3": "IND"},
+ "ID": {"name": _("Indonesia"), "alpha3": "IDN"},
+ "IR": {"name": _("Iran, Islamic Republic Of"), "alpha3": "IRN"},
+ "IQ": {"name": _("Iraq"), "alpha3": "IRQ"},
+ "IE": {"name": _("Ireland"), "alpha3": "IRL"},
+ "IM": {"name": _("Isle of Man"), "alpha3": "IMN"},
+ "IL": {"name": _("Israel"), "alpha3": "ISR"},
+ "IT": {"name": _("Italy"), "alpha3": "ITA"},
+ "JM": {"name": _("Jamaica"), "alpha3": "JAM"},
+ "JP": {"name": _("Japan"), "alpha3": "JPN"},
+ "JE": {"name": _("Jersey"), "alpha3": "JEY"},
+ "JO": {"name": _("Jordan"), "alpha3": "JOR"},
+ "KZ": {"name": _("Kazakhstan"), "alpha3": "KAZ"},
+ "KE": {"name": _("Kenya"), "alpha3": "KEN"},
+ "KI": {"name": _("Kiribati"), "alpha3": "KIR"},
+ "KP": {"name": _("Korea, Democratic People's Republic of"), "alpha3": "PRK"},
+ "KR": {"name": _("Korea, Republic of"), "alpha3": "KOR"},
+ "KW": {"name": _("Kuwait"), "alpha3": "KWT"},
+ "KG": {"name": _("Kyrgyzstan"), "alpha3": "KGZ"},
+ "LA": {"name": _("Lao People's Democratic Republic"), "alpha3": "LAO"},
+ "LV": {"name": _("Latvia"), "alpha3": "LVA"},
+ "LB": {"name": _("Lebanon"), "alpha3": "LBN"},
+ "LS": {"name": _("Lesotho"), "alpha3": "LSO"},
+ "LR": {"name": _("Liberia"), "alpha3": "LBR"},
+ "LY": {"name": _("Libyan Arab Jamahiriya"), "alpha3": "LBY"},
+ "LI": {"name": _("Liechtenstein"), "alpha3": "LIE"},
+ "LT": {"name": _("Lithuania"), "alpha3": "LTU"},
+ "LU": {"name": _("Luxembourg"), "alpha3": "LUX"},
+ "MO": {"name": _("Macao"), "alpha3": "MAC"},
+ "MK": {"name": _("Macedonia, The Former Yugoslav Republic of"), "alpha3": "MKD"},
+ "MG": {"name": _("Madagascar"), "alpha3": "MDG"},
+ "MW": {"name": _("Malawi"), "alpha3": "MWI"},
+ "MY": {"name": _("Malaysia"), "alpha3": "MYS"},
+ "MV": {"name": _("Maldives"), "alpha3": "MDV"},
+ "ML": {"name": _("Mali"), "alpha3": "MLI"},
+ "MT": {"name": _("Malta"), "alpha3": "MLT"},
+ "MH": {"name": _("Marshall Islands"), "alpha3": "MHL"},
+ "MQ": {"name": _("Martinique"), "alpha3": "MTQ"},
+ "MR": {"name": _("Mauritania"), "alpha3": "MRT"},
+ "MU": {"name": _("Mauritius"), "alpha3": "MUS"},
+ "YT": {"name": _("Mayotte"), "alpha3": "MYT"},
+ "MX": {"name": _("Mexico"), "alpha3": "MEX"},
+ "FM": {"name": _("Micronesia, Federated States of"), "alpha3": "FSM"},
+ "MD": {"name": _("Moldova, Republic of"), "alpha3": "MDA"},
+ "MC": {"name": _("Monaco"), "alpha3": "MCO"},
+ "MN": {"name": _("Mongolia"), "alpha3": "MNG"},
+ "MS": {"name": _("Montserrat"), "alpha3": "MSR"},
+ "MA": {"name": _("Morocco"), "alpha3": "MAR"},
+ "MZ": {"name": _("Mozambique"), "alpha3": "MOZ"},
+ "MM": {"name": _("Myanmar"), "alpha3": "MMR"},
+ "NA": {"name": _("Namibia"), "alpha3": "NAM"},
+ "NR": {"name": _("Nauru"), "alpha3": "NRU"},
+ "NP": {"name": _("Nepal"), "alpha3": "NPL"},
+ "NL": {"name": _("Netherlands"), "alpha3": "NLD"},
+ "AN": {"name": _("Netherlands Antilles"), "alpha3": "ANT"},
+ "NC": {"name": _("New Caledonia"), "alpha3": "NCL"},
+ "NZ": {"name": _("New Zealand"), "alpha3": "NZL"},
+ "NI": {"name": _("Nicaragua"), "alpha3": "NIC"},
+ "NE": {"name": _("Niger"), "alpha3": "NER"},
+ "NG": {"name": _("Nigeria"), "alpha3": "NGA"},
+ "NU": {"name": _("Niue"), "alpha3": "NIU"},
+ "NF": {"name": _("Norfolk Island"), "alpha3": "NFK"},
+ "MP": {"name": _("Northern Mariana Islands"), "alpha3": "MNP"},
+ "NO": {"name": _("Norway"), "alpha3": "NOR"},
+ "OM": {"name": _("Oman"), "alpha3": "OMN"},
+ "PK": {"name": _("Pakistan"), "alpha3": "PAK"},
+ "PW": {"name": _("Palau"), "alpha3": "PLW"},
+ "PS": {"name": _("Palestinian Territory, Occupied"), "alpha3": "PSE"},
+ "PA": {"name": _("Panama"), "alpha3": "PAN"},
+ "PG": {"name": _("Papua New Guinea"), "alpha3": "PNG"},
+ "PY": {"name": _("Paraguay"), "alpha3": "PRY"},
+ "PE": {"name": _("Peru"), "alpha3": "PER"},
+ "PH": {"name": _("Philippines"), "alpha3": "PHL"},
+ "PN": {"name": _("Pitcairn"), "alpha3": "PCN"},
+ "PL": {"name": _("Poland"), "alpha3": "POL"},
+ "PT": {"name": _("Portugal"), "alpha3": "PRT"},
+ "PR": {"name": _("Puerto Rico"), "alpha3": "PRI"},
+ "QA": {"name": _("Qatar"), "alpha3": "QAT"},
+ "RE": {"name": _("Reunion"), "alpha3": "REU"},
+ "RO": {"name": _("Romania"), "alpha3": "ROU"},
+ "RU": {"name": _("Russian Federation"), "alpha3": "RUS"},
+ "RW": {"name": _("Rwanda"), "alpha3": "RWA"},
+ "SH": {"name": _("Saint Helena"), "alpha3": "SHN"},
+ "KN": {"name": _("Saint Kitts and Nevis"), "alpha3": "KNA"},
+ "LC": {"name": _("Saint Lucia"), "alpha3": "LCA"},
+ "PM": {"name": _("Saint Pierre and Miquelon"), "alpha3": "SPM"},
+ "VC": {"name": _("Saint Vincent and the Grenadines"), "alpha3": "VCT"},
+ "WS": {"name": _("Samoa"), "alpha3": "WSM"},
+ "SM": {"name": _("San Marino"), "alpha3": "SMR"},
+ "ST": {"name": _("Sao Tome and Principe"), "alpha3": "STP"},
+ "SA": {"name": _("Saudi Arabia"), "alpha3": "SAU"},
+ "SN": {"name": _("Senegal"), "alpha3": "SEN"},
+ "CS": {"name": _("Serbia and Montenegro"), "alpha3": "SCG"},
+ "SC": {"name": _("Seychelles"), "alpha3": "SYC"},
+ "SL": {"name": _("Sierra Leone"), "alpha3": "SLE"},
+ "SG": {"name": _("Singapore"), "alpha3": "SGP"},
+ "SK": {"name": _("Slovakia"), "alpha3": "SVK"},
+ "SI": {"name": _("Slovenia"), "alpha3": "SVN"},
+ "SB": {"name": _("Solomon Islands"), "alpha3": "SLB"},
+ "SO": {"name": _("Somalia"), "alpha3": "SOM"},
+ "ZA": {"name": _("South Africa"), "alpha3": "ZAF"},
+ "GS": {"name": _("South Georgia and the South Sandwich Islands"), "alpha3": "SGS"},
+ "ES": {"name": _("Spain"), "alpha3": "ESP"},
+ "LK": {"name": _("Sri Lanka"), "alpha3": "LKA"},
+ "SD": {"name": _("Sudan"), "alpha3": "SDN"},
+ "SR": {"name": _("Suriname"), "alpha3": "SUR"},
+ "SJ": {"name": _("Svalbard and Jan Mayen"), "alpha3": "SJM"},
+ "SZ": {"name": _("Swaziland"), "alpha3": "SWZ"},
+ "SE": {"name": _("Sweden"), "alpha3": "SWE"},
+ "CH": {"name": _("Switzerland"), "alpha3": "CHE"},
+ "SY": {"name": _("Syrian Arab Republic"), "alpha3": "SYR"},
+ "TW": {"name": _("Taiwan, Province of China"), "alpha3": "TWN"},
+ "TJ": {"name": _("Tajikistan"), "alpha3": "TJK"},
+ "TZ": {"name": _("Tanzania, United Republic of"), "alpha3": "TZA"},
+ "TH": {"name": _("Thailand"), "alpha3": "THA"},
+ "TL": {"name": _("Timor-Leste"), "alpha3": "TLS"},
+ "TG": {"name": _("Togo"), "alpha3": "TGO"},
+ "TK": {"name": _("Tokelau"), "alpha3": "TKL"},
+ "TO": {"name": _("Tonga"), "alpha3": "TON"},
+ "TT": {"name": _("Trinidad and Tobago"), "alpha3": "TTO"},
+ "TN": {"name": _("Tunisia"), "alpha3": "TUN"},
+ "TR": {"name": _("Türkiye"), "alpha3": "TUR"},
+ "TM": {"name": _("Turkmenistan"), "alpha3": "TKM"},
+ "TC": {"name": _("Turks and Caicos Islands"), "alpha3": "TCA"},
+ "TV": {"name": _("Tuvalu"), "alpha3": "TUV"},
+ "UG": {"name": _("Uganda"), "alpha3": "UGA"},
+ "UA": {"name": _("Ukraine"), "alpha3": "UKR"},
+ "AE": {"name": _("United Arab Emirates"), "alpha3": "ARE"},
+ "GB": {"name": _("United Kingdom"), "alpha3": "GBR"},
+ "US": {"name": _("United States"), "alpha3": "USA"},
+ "UM": {"name": _("United States Minor Outlying Islands"), "alpha3": "UMI"},
+ "UY": {"name": _("Uruguay"), "alpha3": "URY"},
+ "UZ": {"name": _("Uzbekistan"), "alpha3": "UZB"},
+ "VU": {"name": _("Vanuatu"), "alpha3": "VUT"},
+ "VE": {"name": _("Venezuela"), "alpha3": "VEN"},
+ "VN": {"name": _("Viet Nam"), "alpha3": "VNM"},
+ "VG": {"name": _("Virgin Islands, British"), "alpha3": "VGB"},
+ "VI": {"name": _("Virgin Islands, U.S."), "alpha3": "VIR"},
+ "WF": {"name": _("Wallis and Futuna"), "alpha3": "WLF"},
+ "EH": {"name": _("Western Sahara"), "alpha3": "ESH"},
+ "YE": {"name": _("Yemen"), "alpha3": "YEM"},
+ "ZM": {"name": _("Zambia"), "alpha3": "ZMB"},
+ "ZW": {"name": _("Zimbabwe"), "alpha3": "ZWE"},
+}
+
+
+def get_countries():
+ """
+ Get the 'COUNTRIES' dictionary with optional customizations.
+
+ Returns:
+ dict: A dictionary containing country information.
+ """
+ countries = getattr(settings, "OVERRIDE_COUNTRIES", DATA)
+
+ exclude_countries = getattr(settings, "EXCLUDE_COUNTRIES", [])
+ if exclude_countries:
+ countries = {code: name for code, name in countries.items() if code not in exclude_countries}
+
+ include_countries = getattr(settings, "INCLUDE_COUNTRIES", [])
+ if include_countries:
+ countries = countries.update(include_countries)
+
+ return countries
diff --git a/django_country_kit/fields.py b/django_country_kit/fields.py
new file mode 100644
index 0000000..e8535eb
--- /dev/null
+++ b/django_country_kit/fields.py
@@ -0,0 +1,223 @@
+"""
+Django forms for working with country fields.
+
+This module provides custom form fields and widgets for working with country data in Django applications.
+It includes a custom field `CountryField` that extends Django's `CharField` to handle country data efficiently.
+Additionally, it includes a custom list type `MultiSelectList` used
+for handling multiple selections within the `CountryField`.
+
+Classes:
+ - MultiSelectList: Represents a list with multiple selections.
+ - CountryField: A custom field for storing country data.
+
+The `CountryField` class extends Django's `CharField` to provide specialized
+functionality for storing and handling country data.
+It supports both single and multiple country selections,
+with customizable options for the field's appearance and behavior.
+
+The `MultiSelectList` class is a custom list type used within the `CountryField`
+for managing multiple selections efficiently.
+It provides methods for string representation and initialization based on a dictionary of choices.
+
+This module is intended to be used in Django projects where country-related data needs
+to be stored and managed in forms and models.
+
+Dependencies:
+ - Django: The web framework for building Django applications.
+"""
+
+from django import forms
+from django.core import exceptions
+from django.db.models.fields import BLANK_CHOICE_DASH, CharField
+
+from .base import Country
+from .widgets import CountryWidget, MultipleCountryWidget
+
+
+class MultiSelectList(list):
+ """
+ A list subclass representing a multi-select list with associated choices.
+
+ This class extends the built-in list class to provide additional functionality
+ for a multi-select list, where each item in the list corresponds to a choice
+ from a predefined set of choices.
+
+ Attributes:
+ choices (dict): A dictionary representing the available choices.
+ The keys are the choice values, and the values are the corresponding
+ choice data or descriptions.
+ """
+ def __init__(self, choices, *args, **kwargs):
+ self.choices = choices
+ super().__init__(*args, **kwargs)
+
+ def __str__(self):
+ msg_list = [self.choices.get(int(i)) if i.isdigit() else self.choices.get(i) for i in self]
+ return ', '.join([str(s) for s in msg_list])
+
+
+class CountryField(CharField):
+ """
+ A custom field for storing country data.
+
+ Inherits from CharField.
+ """
+ def __init__(self, *args, **kwargs):
+ """
+ Initializes a CountryField instance.
+
+ Args:
+ *args: Variable length argument list.
+ **kwargs: Arbitrary keyword arguments.
+ """
+ self.countries = Country().countries_data
+ self.multiple = kwargs.pop('multiple', False)
+ self.blank_label = kwargs.pop("blank_label", None)
+ self.choices = kwargs.pop("countries", [(code, data['name']) for code, data in self.countries.items()])
+ kwargs['choices'] = self.choices
+ if self.multiple:
+ kwargs['max_length'] = len(self.countries) - 1 + sum(len(code) for code in self.countries)
+ else:
+ kwargs['max_length'] = max(len(code) for code in self.countries)
+ super().__init__(*args, **kwargs)
+
+ def get_choices(self, *args, include_blank=True, blank_choice=None, **kwargs):
+ if blank_choice is None:
+ if self.blank_label is None:
+ blank_choice = BLANK_CHOICE_DASH
+ else:
+ blank_choice = [("", self.blank_label)]
+ if self.multiple:
+ include_blank = False
+ return super().get_choices(
+ *args, include_blank=include_blank, blank_choice=blank_choice, **kwargs
+ )
+
+ def get_choices_selected(self, arr_choices):
+ """
+ Retrieve selected choices from an array of choices.
+
+ Args:
+ arr_choices (list): A list of tuples where each tuple represents a choice.
+ Each choice tuple should have the format (choice_value, choice_data),
+ where choice_value is the value of the choice and choice_data is optional.
+
+ Returns:
+ list: A list of selected choice values converted to strings.
+ """
+ named_groups = arr_choices and isinstance(arr_choices[0][1], (list, tuple))
+ choices_selected = []
+ if named_groups:
+ for choice_group_selected in arr_choices:
+ for choice_selected in choice_group_selected[1]:
+ choices_selected.append(str(choice_selected[0]))
+ else:
+ for choice_selected in arr_choices:
+ choices_selected.append(str(choice_selected[0]))
+ return choices_selected
+
+ def value_to_string(self, obj):
+ try:
+ value = self._get_val_from_obj(obj)
+ except AttributeError:
+ value = super().value_from_object(obj)
+ return self.get_prep_value(value)
+
+ def validate(self, value, model_instance): # pylint: disable=inconsistent-return-statements
+ if not self.multiple:
+ return super().validate(value, model_instance)
+ arr_choices = self.get_choices_selected(self.get_choices(include_blank=False))
+ for opt_select in value:
+ if opt_select not in arr_choices:
+ raise exceptions.ValidationError(self.error_messages['invalid_choice'] % {"value": value})
+
+ def get_default(self):
+ default = super().get_default()
+ if not self.multiple:
+ return default
+ if isinstance(default, int):
+ default = str(default)
+ return default
+
+ def formfield(self, **kwargs):
+ defaults = {
+ 'required': not self.blank,
+ 'help_text': self.help_text,
+ 'choices': self.choices,
+ 'widget': CountryWidget if not self.multiple else MultipleCountryWidget,
+ }
+ if self.has_default():
+ defaults['initial'] = self.get_default()
+ defaults.update(kwargs)
+ if self.multiple:
+ return forms.TypedMultipleChoiceField(**defaults)
+ return forms.TypedChoiceField(**defaults)
+
+ def get_prep_value(self, value):
+ return '' if value is None else ",".join(map(str, value))
+
+ def get_db_prep_value(self, value, connection, prepared=False):
+ if not prepared and not isinstance(value, str):
+ value = self.get_prep_value(value)
+ return value
+
+ def to_python(self, value):
+ if not self.multiple:
+ return super().to_python(value)
+ choices = dict(self.flatchoices)
+
+ if value:
+ if isinstance(value, list):
+ return value
+ if isinstance(value, str):
+ value_list = map(lambda x: x.strip(), value.replace(',', ',').split(','))
+ return MultiSelectList(choices, value_list)
+ if isinstance(value, (set, dict)):
+ return MultiSelectList(choices, list(value))
+ return MultiSelectList(choices, [])
+
+ def from_db_value(self, value, expression, connection): # pylint: disable=unused-argument
+ """
+ Convert a database value to a Python object.
+
+ This method is used by Django to convert a value fetched from the database
+ into the appropriate Python object before assigning it to the model field.
+
+ Args:
+ value: The database value to be converted.
+ expression: The database expression used in the query.
+ connection: The database connection.
+
+ Returns:
+ The Python object representing the converted value.
+
+ Note:
+ This method is primarily used in custom model fields.
+ """
+ if value is None:
+ return value
+ return self.to_python(value)
+
+ def contribute_to_class(self, cls, name, private_only=False):
+ super().contribute_to_class(cls, name)
+
+ if not self.multiple:
+ return
+
+ if self.choices:
+ choicedict = dict(self.choices)
+
+ def get_list(obj):
+ field_value = getattr(obj, name)
+ if field_value:
+ display = [str(choicedict.get(value, value)) for value in field_value]
+ return display
+ return []
+
+ def get_display(obj):
+ return ", ".join(get_list(obj))
+
+ get_display.short_description = self.verbose_name
+
+ setattr(cls, f'get_{self.name}_list', get_list)
+ setattr(cls, f'get_{self.name}_display', get_display)
diff --git a/django_country_kit/locale/de/LC_MESSAGES/django.mo b/django_country_kit/locale/de/LC_MESSAGES/django.mo
new file mode 100644
index 0000000..71cbdf3
Binary files /dev/null and b/django_country_kit/locale/de/LC_MESSAGES/django.mo differ
diff --git a/django_country_kit/locale/de/LC_MESSAGES/django.po b/django_country_kit/locale/de/LC_MESSAGES/django.po
new file mode 100644
index 0000000..634cb14
--- /dev/null
+++ b/django_country_kit/locale/de/LC_MESSAGES/django.po
@@ -0,0 +1,991 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR , YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2024-01-26 10:10+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: LANGUAGE \n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: django_country_kit/data.py:33
+msgid "Afghanistan"
+msgstr "Afghanistan"
+
+#: django_country_kit/data.py:34
+msgid "Åland Islands"
+msgstr "Åland-Inseln"
+
+#: django_country_kit/data.py:35
+msgid "Albania"
+msgstr "Albanien"
+
+#: django_country_kit/data.py:36
+msgid "Algeria"
+msgstr "Algerien"
+
+#: django_country_kit/data.py:37
+msgid "American Samoa"
+msgstr "Amerikanisch-Samoa"
+
+#: django_country_kit/data.py:38
+msgid "Andorra"
+msgstr "Andorra"
+
+#: django_country_kit/data.py:39
+msgid "Angola"
+msgstr "Angola"
+
+#: django_country_kit/data.py:40
+msgid "Anguilla"
+msgstr "Anguilla"
+
+#: django_country_kit/data.py:41
+msgid "Antarctica"
+msgstr "Antarktis"
+
+#: django_country_kit/data.py:42
+msgid "Antigua and Barbuda"
+msgstr "Antigua und Barbuda"
+
+#: django_country_kit/data.py:43
+msgid "Argentina"
+msgstr "Argentinien"
+
+#: django_country_kit/data.py:44
+msgid "Armenia"
+msgstr "Armenien"
+
+#: django_country_kit/data.py:45
+msgid "Aruba"
+msgstr "Aruba"
+
+#: django_country_kit/data.py:46
+msgid "Australia"
+msgstr "Australien"
+
+#: django_country_kit/data.py:47
+msgid "Austria"
+msgstr "Österreich"
+
+#: django_country_kit/data.py:48
+msgid "Azerbaijan"
+msgstr "Aserbaidschan"
+
+#: django_country_kit/data.py:49
+msgid "Bahamas"
+msgstr "Bahamas"
+
+#: django_country_kit/data.py:50
+msgid "Bahrain"
+msgstr "Bahrain"
+
+#: django_country_kit/data.py:51
+msgid "Bangladesh"
+msgstr "Bangladesch"
+
+#: django_country_kit/data.py:52
+msgid "Barbados"
+msgstr "Barbados"
+
+#: django_country_kit/data.py:53
+msgid "Belarus"
+msgstr "Belarus"
+
+#: django_country_kit/data.py:54
+msgid "Belgium"
+msgstr "Belgien"
+
+#: django_country_kit/data.py:55
+msgid "Belize"
+msgstr "Belize"
+
+#: django_country_kit/data.py:56
+msgid "Benin"
+msgstr "Benin"
+
+#: django_country_kit/data.py:57
+msgid "Bermuda"
+msgstr "Bermuda"
+
+#: django_country_kit/data.py:58
+msgid "Bhutan"
+msgstr "Bhutan"
+
+#: django_country_kit/data.py:59
+msgid "Bolivia"
+msgstr "Bolivien"
+
+#: django_country_kit/data.py:60
+msgid "Bosnia and Herzegovina"
+msgstr "Bosnien und Herzegowina"
+
+#: django_country_kit/data.py:61
+msgid "Botswana"
+msgstr "Botswana"
+
+#: django_country_kit/data.py:62
+msgid "Bouvet Island"
+msgstr "Bouvetinsel"
+
+#: django_country_kit/data.py:63
+msgid "Brazil"
+msgstr "Brasilien"
+
+#: django_country_kit/data.py:64
+msgid "British Indian Ocean Territory"
+msgstr "Britisches Territorium im Indischen Ozean"
+
+#: django_country_kit/data.py:65
+msgid "Brunei Darussalam"
+msgstr "Brunei Darussalam"
+
+#: django_country_kit/data.py:66
+msgid "Bulgaria"
+msgstr "Bulgarien"
+
+#: django_country_kit/data.py:67
+msgid "Burkina Faso"
+msgstr "Burkina Faso"
+
+#: django_country_kit/data.py:68
+msgid "Burundi"
+msgstr "Burundi"
+
+#: django_country_kit/data.py:69
+msgid "Cambodia"
+msgstr "Kambodscha"
+
+#: django_country_kit/data.py:70
+msgid "Cameroon"
+msgstr "Kamerun"
+
+#: django_country_kit/data.py:71
+msgid "Canada"
+msgstr "Kanada"
+
+#: django_country_kit/data.py:72
+msgid "Cape Verde"
+msgstr "Kap Verde"
+
+#: django_country_kit/data.py:73
+msgid "Cayman Islands"
+msgstr "Kaimaninseln"
+
+#: django_country_kit/data.py:74
+msgid "Central African Republic"
+msgstr "Zentralafrikanische Republik"
+
+#: django_country_kit/data.py:75
+msgid "Chad"
+msgstr "Tschad"
+
+#: django_country_kit/data.py:76
+msgid "Chile"
+msgstr "Chile"
+
+#: django_country_kit/data.py:77
+msgid "China"
+msgstr "China"
+
+#: django_country_kit/data.py:78
+msgid "Christmas Island"
+msgstr "Weihnachtsinsel"
+
+#: django_country_kit/data.py:79
+msgid "Cocos (Keeling) Islands"
+msgstr "Kokosinseln"
+
+#: django_country_kit/data.py:80
+msgid "Colombia"
+msgstr "Kolumbien"
+
+#: django_country_kit/data.py:81
+msgid "Comoros"
+msgstr "Komoren"
+
+#: django_country_kit/data.py:82
+msgid "Congo"
+msgstr "Kongo"
+
+#: django_country_kit/data.py:83
+msgid "Congo, The Democratic Republic of the"
+msgstr "Åland-Inseln"
+
+#: django_country_kit/data.py:84
+msgid "Cook Islands"
+msgstr "Albanien"
+
+#: django_country_kit/data.py:85
+msgid "Costa Rica"
+msgstr "Algerien"
+
+#: django_country_kit/data.py:86
+msgid "Cote D'Ivoire"
+msgstr "Amerikanisch-Samoa"
+
+#: django_country_kit/data.py:87
+msgid "Croatia"
+msgstr "Andorra"
+
+#: django_country_kit/data.py:88
+msgid "Cuba"
+msgstr "Angola"
+
+#: django_country_kit/data.py:89
+msgid "Cyprus"
+msgstr "Anguilla"
+
+#: django_country_kit/data.py:90
+msgid "Czech Republic"
+msgstr "Antarktis"
+
+#: django_country_kit/data.py:91
+msgid "Denmark"
+msgstr "Antigua und Barbuda"
+
+#: django_country_kit/data.py:92
+msgid "Djibouti"
+msgstr "Argentinien"
+
+#: django_country_kit/data.py:93
+msgid "Dominica"
+msgstr "Armenien"
+
+#: django_country_kit/data.py:94
+msgid "Dominican Republic"
+msgstr "Aruba"
+
+#: django_country_kit/data.py:95
+msgid "Ecuador"
+msgstr "Australien"
+
+#: django_country_kit/data.py:96
+msgid "Egypt"
+msgstr "Österreich"
+
+#: django_country_kit/data.py:97
+msgid "El Salvador"
+msgstr "Aserbaidschan"
+
+#: django_country_kit/data.py:98
+msgid "Equatorial Guinea"
+msgstr "Bahamas"
+
+#: django_country_kit/data.py:99
+msgid "Eritrea"
+msgstr "Bahrain"
+
+#: django_country_kit/data.py:100
+msgid "Estonia"
+msgstr "Bangladesch"
+
+#: django_country_kit/data.py:101
+msgid "Ethiopia"
+msgstr "Barbados"
+
+#: django_country_kit/data.py:102
+msgid "Falkland Islands (Malvinas)"
+msgstr "Belarus"
+
+#: django_country_kit/data.py:103
+msgid "Faroe Islands"
+msgstr "Belgien"
+
+#: django_country_kit/data.py:104
+msgid "Fiji"
+msgstr "Belize"
+
+#: django_country_kit/data.py:105
+msgid "Finland"
+msgstr "Benin"
+
+#: django_country_kit/data.py:106
+msgid "France"
+msgstr "Bermuda"
+
+#: django_country_kit/data.py:107
+msgid "French Guiana"
+msgstr "Bhutan"
+
+#: django_country_kit/data.py:108
+msgid "French Polynesia"
+msgstr "Bolivien"
+
+#: django_country_kit/data.py:109
+msgid "French Southern Territories"
+msgstr "Bosnien und Herzegowina"
+
+#: django_country_kit/data.py:110
+msgid "Gabon"
+msgstr "Botsuana"
+
+#: django_country_kit/data.py:111
+msgid "Gambia"
+msgstr "Bouvetinsel"
+
+#: django_country_kit/data.py:112
+msgid "Georgia"
+msgstr "Brasilien"
+
+#: django_country_kit/data.py:113
+msgid "Germany"
+msgstr "Britisches Territorium im Indischen Ozean"
+
+#: django_country_kit/data.py:114
+msgid "Ghana"
+msgstr "Brunei Darussalam"
+
+#: django_country_kit/data.py:115
+msgid "Gibraltar"
+msgstr "Bulgarien"
+
+#: django_country_kit/data.py:116
+msgid "Greece"
+msgstr "Burkina Faso"
+
+#: django_country_kit/data.py:117
+msgid "Greenland"
+msgstr "Burundi"
+
+#: django_country_kit/data.py:118
+msgid "Grenada"
+msgstr "Kambodscha"
+
+#: django_country_kit/data.py:119
+msgid "Guadeloupe"
+msgstr "Kamerun"
+
+#: django_country_kit/data.py:120
+msgid "Guam"
+msgstr "Kanada"
+
+#: django_country_kit/data.py:121
+msgid "Guatemala"
+msgstr "Kap Verde"
+
+#: django_country_kit/data.py:122
+msgid "Guernsey"
+msgstr "Kaimaninseln"
+
+#: django_country_kit/data.py:123
+msgid "Guinea"
+msgstr "Zentralafrikanische Republik"
+
+#: django_country_kit/data.py:124
+msgid "Guinea-Bissau"
+msgstr "Tschad"
+
+#: django_country_kit/data.py:125
+msgid "Guyana"
+msgstr "Chile"
+
+#: django_country_kit/data.py:126
+msgid "Haiti"
+msgstr "China"
+
+#: django_country_kit/data.py:127
+msgid "Heard Island and Mcdonald Islands"
+msgstr "Weihnachtsinsel"
+
+#: django_country_kit/data.py:128
+msgid "Holy See (Vatican City State)"
+msgstr "Kokosinseln"
+
+#: django_country_kit/data.py:129
+msgid "Honduras"
+msgstr "Kolumbien"
+
+#: django_country_kit/data.py:130
+msgid "Hong Kong"
+msgstr "Komoren"
+
+#: django_country_kit/data.py:131
+msgid "Hungary"
+msgstr "Kongo"
+
+#: django_country_kit/data.py:132
+msgid "Iceland"
+msgstr "Kongo, Demokratische Republik der"
+
+#: django_country_kit/data.py:133
+msgid "India"
+msgstr "Albanien"
+
+#: django_country_kit/data.py:134
+msgid "Indonesia"
+msgstr "Algerien"
+
+#: django_country_kit/data.py:135
+msgid "Iran, Islamic Republic Of"
+msgstr "Amerikanisch-Samoa"
+
+#: django_country_kit/data.py:136
+msgid "Iraq"
+msgstr "Andorra"
+
+#: django_country_kit/data.py:137
+msgid "Ireland"
+msgstr "Angola"
+
+#: django_country_kit/data.py:138
+msgid "Isle of Man"
+msgstr "Anguilla"
+
+#: django_country_kit/data.py:139
+msgid "Israel"
+msgstr "Antarktis"
+
+#: django_country_kit/data.py:140
+msgid "Italy"
+msgstr "Antigua und Barbuda"
+
+#: django_country_kit/data.py:141
+msgid "Jamaica"
+msgstr "Argentinien"
+
+#: django_country_kit/data.py:142
+msgid "Japan"
+msgstr "Armenien"
+
+#: django_country_kit/data.py:143
+msgid "Jersey"
+msgstr "Aruba"
+
+#: django_country_kit/data.py:144
+msgid "Jordan"
+msgstr "Australien"
+
+#: django_country_kit/data.py:145
+msgid "Kazakhstan"
+msgstr "Österreich"
+
+#: django_country_kit/data.py:146
+msgid "Kenya"
+msgstr "Aserbaidschan"
+
+#: django_country_kit/data.py:147
+msgid "Kiribati"
+msgstr "Bahamas"
+
+#: django_country_kit/data.py:148
+msgid "Korea, Democratic People's Republic of"
+msgstr "Bahrain"
+
+#: django_country_kit/data.py:149
+msgid "Korea, Republic of"
+msgstr "Bangladesch"
+
+#: django_country_kit/data.py:150
+msgid "Kuwait"
+msgstr "Barbados"
+
+#: django_country_kit/data.py:151
+msgid "Kyrgyzstan"
+msgstr "Weißrussland"
+
+#: django_country_kit/data.py:152
+msgid "Lao People's Democratic Republic"
+msgstr "Belgien"
+
+#: django_country_kit/data.py:153
+msgid "Latvia"
+msgstr "Belize"
+
+#: django_country_kit/data.py:154
+msgid "Lebanon"
+msgstr "Benin"
+
+#: django_country_kit/data.py:155
+msgid "Lesotho"
+msgstr "Bermuda"
+
+#: django_country_kit/data.py:156
+msgid "Liberia"
+msgstr "Bhutan"
+
+#: django_country_kit/data.py:157
+msgid "Libyan Arab Jamahiriya"
+msgstr "Bolivien"
+
+#: django_country_kit/data.py:158
+msgid "Liechtenstein"
+msgstr "Bosnien und Herzegowina"
+
+#: django_country_kit/data.py:159
+msgid "Lithuania"
+msgstr "Botswana"
+
+#: django_country_kit/data.py:160
+msgid "Luxembourg"
+msgstr "Bouvetinsel"
+
+#: django_country_kit/data.py:161
+msgid "Macao"
+msgstr "Brasilien"
+
+#: django_country_kit/data.py:162
+msgid "Macedonia, The Former Yugoslav Republic of"
+msgstr "Britisches Territorium im Indischen Ozean"
+
+#: django_country_kit/data.py:163
+msgid "Madagascar"
+msgstr "Brunei Darussalam"
+
+#: django_country_kit/data.py:164
+msgid "Malawi"
+msgstr "Bulgarien"
+
+#: django_country_kit/data.py:165
+msgid "Malaysia"
+msgstr "Burkina Faso"
+
+#: django_country_kit/data.py:166
+msgid "Maldives"
+msgstr "Burundi"
+
+#: django_country_kit/data.py:167
+msgid "Mali"
+msgstr "Kambodscha"
+
+#: django_country_kit/data.py:168
+msgid "Malta"
+msgstr "Kamerun"
+
+#: django_country_kit/data.py:169
+msgid "Marshall Islands"
+msgstr "Kanada"
+
+#: django_country_kit/data.py:170
+msgid "Martinique"
+msgstr "Kap Verde"
+
+#: django_country_kit/data.py:171
+msgid "Mauritania"
+msgstr "Kaimaninseln"
+
+#: django_country_kit/data.py:172
+msgid "Mauritius"
+msgstr "Zentralafrikanische Republik"
+
+#: django_country_kit/data.py:173
+msgid "Mayotte"
+msgstr "Tschad"
+
+#: django_country_kit/data.py:174
+msgid "Mexico"
+msgstr "Chile"
+
+#: django_country_kit/data.py:175
+msgid "Micronesia, Federated States of"
+msgstr "China"
+
+#: django_country_kit/data.py:176
+msgid "Moldova, Republic of"
+msgstr "Weihnachtsinsel"
+
+#: django_country_kit/data.py:177
+msgid "Monaco"
+msgstr "Kokosinseln"
+
+#: django_country_kit/data.py:178
+msgid "Mongolia"
+msgstr "Kolumbien"
+
+#: django_country_kit/data.py:179
+msgid "Montserrat"
+msgstr "Komoren"
+
+#: django_country_kit/data.py:180
+msgid "Morocco"
+msgstr "Kongo"
+
+#: django_country_kit/data.py:181
+msgid "Mozambique"
+msgstr "Kongo, Demokratische Republik des"
+
+#: django_country_kit/data.py:182
+msgid "Myanmar"
+msgstr "Cookinseln"
+
+#: django_country_kit/data.py:183
+msgid "Namibia"
+msgstr "Algerien"
+
+#: django_country_kit/data.py:184
+msgid "Nauru"
+msgstr "Amerikanisch-Samoa"
+
+#: django_country_kit/data.py:185
+msgid "Nepal"
+msgstr "Andorra"
+
+#: django_country_kit/data.py:186
+msgid "Netherlands"
+msgstr "Angola"
+
+#: django_country_kit/data.py:187
+msgid "Netherlands Antilles"
+msgstr "Anguilla"
+
+#: django_country_kit/data.py:188
+msgid "New Caledonia"
+msgstr "Antarktis"
+
+#: django_country_kit/data.py:189
+msgid "New Zealand"
+msgstr "Antigua und Barbuda"
+
+#: django_country_kit/data.py:190
+msgid "Nicaragua"
+msgstr "Argentinien"
+
+#: django_country_kit/data.py:191
+msgid "Niger"
+msgstr "Armenien"
+
+#: django_country_kit/data.py:192
+msgid "Nigeria"
+msgstr "Aruba"
+
+#: django_country_kit/data.py:193
+msgid "Niue"
+msgstr "Australien"
+
+#: django_country_kit/data.py:194
+msgid "Norfolk Island"
+msgstr "Österreich"
+
+#: django_country_kit/data.py:195
+msgid "Northern Mariana Islands"
+msgstr "Aserbaidschan"
+
+#: django_country_kit/data.py:196
+msgid "Norway"
+msgstr "Bahamas"
+
+#: django_country_kit/data.py:197
+msgid "Oman"
+msgstr "Bahrain"
+
+#: django_country_kit/data.py:198
+msgid "Pakistan"
+msgstr "Bangladesch"
+
+#: django_country_kit/data.py:199
+msgid "Palau"
+msgstr "Barbados"
+
+#: django_country_kit/data.py:200
+msgid "Palestinian Territory, Occupied"
+msgstr "Belarus"
+
+#: django_country_kit/data.py:201
+msgid "Panama"
+msgstr "Belgien"
+
+#: django_country_kit/data.py:202
+msgid "Papua New Guinea"
+msgstr "Belize"
+
+#: django_country_kit/data.py:203
+msgid "Paraguay"
+msgstr "Benin"
+
+#: django_country_kit/data.py:204
+msgid "Peru"
+msgstr "Bermuda"
+
+#: django_country_kit/data.py:205
+msgid "Philippines"
+msgstr "Bhutan"
+
+#: django_country_kit/data.py:206
+msgid "Pitcairn"
+msgstr "Bolivien"
+
+#: django_country_kit/data.py:207
+msgid "Poland"
+msgstr "Bosnien und Herzegowina"
+
+#: django_country_kit/data.py:208
+msgid "Portugal"
+msgstr "Botsuana"
+
+#: django_country_kit/data.py:209
+msgid "Puerto Rico"
+msgstr "Bouvetinsel"
+
+#: django_country_kit/data.py:210
+msgid "Qatar"
+msgstr "Brasilien"
+
+#: django_country_kit/data.py:211
+msgid "Reunion"
+msgstr "Britisches Territorium im Indischen Ozean"
+
+#: django_country_kit/data.py:212
+msgid "Romania"
+msgstr "Brunei Darussalam"
+
+#: django_country_kit/data.py:213
+msgid "Russian Federation"
+msgstr "Bulgarien"
+
+#: django_country_kit/data.py:214
+msgid "Rwanda"
+msgstr "Burkina Faso"
+
+#: django_country_kit/data.py:215
+msgid "Saint Helena"
+msgstr "Burundi"
+
+#: django_country_kit/data.py:216
+msgid "Saint Kitts and Nevis"
+msgstr "Kambodscha"
+
+#: django_country_kit/data.py:217
+msgid "Saint Lucia"
+msgstr "Kamerun"
+
+#: django_country_kit/data.py:218
+msgid "Saint Pierre and Miquelon"
+msgstr "Kanada"
+
+#: django_country_kit/data.py:219
+msgid "Saint Vincent and the Grenadines"
+msgstr "Kap Verde"
+
+#: django_country_kit/data.py:220
+msgid "Samoa"
+msgstr "Kaimaninseln"
+
+#: django_country_kit/data.py:221
+msgid "San Marino"
+msgstr "Zentralafrikanische Republik"
+
+#: django_country_kit/data.py:222
+msgid "Sao Tome and Principe"
+msgstr "Tschad"
+
+#: django_country_kit/data.py:223
+msgid "Saudi Arabia"
+msgstr "Chile"
+
+#: django_country_kit/data.py:224
+msgid "Senegal"
+msgstr "China"
+
+#: django_country_kit/data.py:225
+msgid "Serbia and Montenegro"
+msgstr "Weihnachtsinsel"
+
+#: django_country_kit/data.py:226
+msgid "Seychelles"
+msgstr "Kokosinseln"
+
+#: django_country_kit/data.py:227
+msgid "Sierra Leone"
+msgstr "Kolumbien"
+
+#: django_country_kit/data.py:228
+msgid "Singapore"
+msgstr "Komoren"
+
+#: django_country_kit/data.py:229
+msgid "Slovakia"
+msgstr "Kongo"
+
+#: django_country_kit/data.py:230
+msgid "Slovenia"
+msgstr "Kongo, Demokratische Republik"
+
+#: django_country_kit/data.py:231
+msgid "Solomon Islands"
+msgstr "Cookinseln"
+
+#: django_country_kit/data.py:232
+msgid "Somalia"
+msgstr "Costa Rica"
+
+#: django_country_kit/data.py:233
+msgid "South Africa"
+msgstr "Amerikanisch-Samoa"
+
+#: django_country_kit/data.py:234
+msgid "South Georgia and the South Sandwich Islands"
+msgstr "Andorra"
+
+#: django_country_kit/data.py:235
+msgid "Spain"
+msgstr "Angola"
+
+#: django_country_kit/data.py:236
+msgid "Sri Lanka"
+msgstr "Anguilla"
+
+#: django_country_kit/data.py:237
+msgid "Sudan"
+msgstr "Antarktis"
+
+#: django_country_kit/data.py:238
+msgid "Suriname"
+msgstr "Antigua und Barbuda"
+
+#: django_country_kit/data.py:239
+msgid "Svalbard and Jan Mayen"
+msgstr "Argentinien"
+
+#: django_country_kit/data.py:240
+msgid "Swaziland"
+msgstr "Armenien"
+
+#: django_country_kit/data.py:241
+msgid "Sweden"
+msgstr "Aruba"
+
+#: django_country_kit/data.py:242
+msgid "Switzerland"
+msgstr "Australien"
+
+#: django_country_kit/data.py:243
+msgid "Syrian Arab Republic"
+msgstr "Österreich"
+
+#: django_country_kit/data.py:244
+msgid "Taiwan, Province of China"
+msgstr "Aserbaidschan"
+
+#: django_country_kit/data.py:245
+msgid "Tajikistan"
+msgstr "Bahamas"
+
+#: django_country_kit/data.py:246
+msgid "Tanzania, United Republic of"
+msgstr "Bahrain"
+
+#: django_country_kit/data.py:247
+msgid "Thailand"
+msgstr "Bangladesch"
+
+#: django_country_kit/data.py:248
+msgid "Timor-Leste"
+msgstr "Barbados"
+
+#: django_country_kit/data.py:249
+msgid "Togo"
+msgstr "Weißrussland"
+
+#: django_country_kit/data.py:250
+msgid "Tokelau"
+msgstr "Belgien"
+
+#: django_country_kit/data.py:251
+msgid "Tonga"
+msgstr "Belize"
+
+#: django_country_kit/data.py:252
+msgid "Trinidad and Tobago"
+msgstr "Benin"
+
+#: django_country_kit/data.py:253
+msgid "Tunisia"
+msgstr "Bermuda"
+
+#: django_country_kit/data.py:254
+msgid "Türkiye"
+msgstr "Bhutan"
+
+#: django_country_kit/data.py:255
+msgid "Turkmenistan"
+msgstr "Bolivien"
+
+#: django_country_kit/data.py:256
+msgid "Turks and Caicos Islands"
+msgstr "Bosnien und Herzegowina"
+
+#: django_country_kit/data.py:257
+msgid "Tuvalu"
+msgstr "Botswana"
+
+#: django_country_kit/data.py:258
+msgid "Uganda"
+msgstr "Bouvetinsel"
+
+#: django_country_kit/data.py:259
+msgid "Ukraine"
+msgstr "Brasilien"
+
+#: django_country_kit/data.py:260
+msgid "United Arab Emirates"
+msgstr "Britisches Territorium im Indischen Ozean"
+
+#: django_country_kit/data.py:261
+msgid "United Kingdom"
+msgstr "Brunei Darussalam"
+
+#: django_country_kit/data.py:262
+msgid "United States"
+msgstr "Bulgarien"
+
+#: django_country_kit/data.py:263
+msgid "United States Minor Outlying Islands"
+msgstr "Burkina Faso"
+
+#: django_country_kit/data.py:264
+msgid "Uruguay"
+msgstr "Burundi"
+
+#: django_country_kit/data.py:265
+msgid "Uzbekistan"
+msgstr "Kambodscha"
+
+#: django_country_kit/data.py:266
+msgid "Vanuatu"
+msgstr "Kamerun"
+
+#: django_country_kit/data.py:267
+msgid "Venezuela"
+msgstr "Kanada"
+
+#: django_country_kit/data.py:268
+msgid "Viet Nam"
+msgstr "Kap Verde"
+
+#: django_country_kit/data.py:269
+msgid "Virgin Islands, British"
+msgstr "Kaimaninseln"
+
+#: django_country_kit/data.py:270
+msgid "Virgin Islands, U.S."
+msgstr "Zentralafrikanische Republik"
+
+#: django_country_kit/data.py:271
+msgid "Wallis and Futuna"
+msgstr "Tschad"
+
+#: django_country_kit/data.py:272
+msgid "Western Sahara"
+msgstr "Chile"
+
+#: django_country_kit/data.py:273
+msgid "Yemen"
+msgstr "China"
+
+#: django_country_kit/data.py:274
+msgid "Zambia"
+msgstr "Weihnachtsinsel"
+
+#: django_country_kit/data.py:275
+msgid "Zimbabwe"
+msgstr "Kokosinseln (Keelinginseln)"
diff --git a/django_country_kit/locale/en/LC_MESSAGES/django.mo b/django_country_kit/locale/en/LC_MESSAGES/django.mo
new file mode 100644
index 0000000..71cbdf3
Binary files /dev/null and b/django_country_kit/locale/en/LC_MESSAGES/django.mo differ
diff --git a/django_country_kit/locale/en/LC_MESSAGES/django.po b/django_country_kit/locale/en/LC_MESSAGES/django.po
new file mode 100644
index 0000000..d4593e3
--- /dev/null
+++ b/django_country_kit/locale/en/LC_MESSAGES/django.po
@@ -0,0 +1,991 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR , YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2024-01-26 10:10+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: LANGUAGE \n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: django_country_kit/data.py:33
+msgid "Afghanistan"
+msgstr "Afghanistan"
+
+#: django_country_kit/data.py:34
+msgid "Åland Islands"
+msgstr "Åland Islands"
+
+#: django_country_kit/data.py:35
+msgid "Albania"
+msgstr "Albania"
+
+#: django_country_kit/data.py:36
+msgid "Algeria"
+msgstr "Algeria"
+
+#: django_country_kit/data.py:37
+msgid "American Samoa"
+msgstr "American Samoa"
+
+#: django_country_kit/data.py:38
+msgid "Andorra"
+msgstr "Andorra"
+
+#: django_country_kit/data.py:39
+msgid "Angola"
+msgstr "Angola"
+
+#: django_country_kit/data.py:40
+msgid "Anguilla"
+msgstr "Anguilla"
+
+#: django_country_kit/data.py:41
+msgid "Antarctica"
+msgstr "Antarctica"
+
+#: django_country_kit/data.py:42
+msgid "Antigua and Barbuda"
+msgstr "Antigua and Barbuda"
+
+#: django_country_kit/data.py:43
+msgid "Argentina"
+msgstr "Argentina"
+
+#: django_country_kit/data.py:44
+msgid "Armenia"
+msgstr "Armenia"
+
+#: django_country_kit/data.py:45
+msgid "Aruba"
+msgstr "Aruba"
+
+#: django_country_kit/data.py:46
+msgid "Australia"
+msgstr "Australia"
+
+#: django_country_kit/data.py:47
+msgid "Austria"
+msgstr "Austria"
+
+#: django_country_kit/data.py:48
+msgid "Azerbaijan"
+msgstr "Azerbaijan"
+
+#: django_country_kit/data.py:49
+msgid "Bahamas"
+msgstr "Bahamas"
+
+#: django_country_kit/data.py:50
+msgid "Bahrain"
+msgstr "Bahrain"
+
+#: django_country_kit/data.py:51
+msgid "Bangladesh"
+msgstr "Bangladesh"
+
+#: django_country_kit/data.py:52
+msgid "Barbados"
+msgstr "Barbados"
+
+#: django_country_kit/data.py:53
+msgid "Belarus"
+msgstr "Belarus"
+
+#: django_country_kit/data.py:54
+msgid "Belgium"
+msgstr "Belgium"
+
+#: django_country_kit/data.py:55
+msgid "Belize"
+msgstr "Belize"
+
+#: django_country_kit/data.py:56
+msgid "Benin"
+msgstr "Benin"
+
+#: django_country_kit/data.py:57
+msgid "Bermuda"
+msgstr "Bermuda"
+
+#: django_country_kit/data.py:58
+msgid "Bhutan"
+msgstr "Bhutan"
+
+#: django_country_kit/data.py:59
+msgid "Bolivia"
+msgstr "Bolivia"
+
+#: django_country_kit/data.py:60
+msgid "Bosnia and Herzegovina"
+msgstr "Bosnia and Herzegovina"
+
+#: django_country_kit/data.py:61
+msgid "Botswana"
+msgstr "Botswana"
+
+#: django_country_kit/data.py:62
+msgid "Bouvet Island"
+msgstr "Bouvet Island"
+
+#: django_country_kit/data.py:63
+msgid "Brazil"
+msgstr "Brazil"
+
+#: django_country_kit/data.py:64
+msgid "British Indian Ocean Territory"
+msgstr "British Indian Ocean Territory"
+
+#: django_country_kit/data.py:65
+msgid "Brunei Darussalam"
+msgstr "Brunei Darussalam"
+
+#: django_country_kit/data.py:66
+msgid "Bulgaria"
+msgstr "Bulgaria"
+
+#: django_country_kit/data.py:67
+msgid "Burkina Faso"
+msgstr "Burkina Faso"
+
+#: django_country_kit/data.py:68
+msgid "Burundi"
+msgstr "Burundi"
+
+#: django_country_kit/data.py:69
+msgid "Cambodia"
+msgstr "Cambodia"
+
+#: django_country_kit/data.py:70
+msgid "Cameroon"
+msgstr "Cameroon"
+
+#: django_country_kit/data.py:71
+msgid "Canada"
+msgstr "Canada"
+
+#: django_country_kit/data.py:72
+msgid "Cape Verde"
+msgstr "Cape Verde"
+
+#: django_country_kit/data.py:73
+msgid "Cayman Islands"
+msgstr "Cayman Islands"
+
+#: django_country_kit/data.py:74
+msgid "Central African Republic"
+msgstr "Central African Republic"
+
+#: django_country_kit/data.py:75
+msgid "Chad"
+msgstr "Chad"
+
+#: django_country_kit/data.py:76
+msgid "Chile"
+msgstr "Chile"
+
+#: django_country_kit/data.py:77
+msgid "China"
+msgstr "China"
+
+#: django_country_kit/data.py:78
+msgid "Christmas Island"
+msgstr "Christmas Island"
+
+#: django_country_kit/data.py:79
+msgid "Cocos (Keeling) Islands"
+msgstr "Cocos (Keeling) Islands"
+
+#: django_country_kit/data.py:80
+msgid "Colombia"
+msgstr "Colombia"
+
+#: django_country_kit/data.py:81
+msgid "Comoros"
+msgstr "Comoros"
+
+#: django_country_kit/data.py:82
+msgid "Congo"
+msgstr "Congo"
+
+#: django_country_kit/data.py:83
+msgid "Congo, The Democratic Republic of the"
+msgstr "Ahvenanmaa"
+
+#: django_country_kit/data.py:84
+msgid "Cook Islands"
+msgstr "Albania"
+
+#: django_country_kit/data.py:85
+msgid "Costa Rica"
+msgstr "Algeria"
+
+#: django_country_kit/data.py:86
+msgid "Cote D'Ivoire"
+msgstr "Amerikan Samoa"
+
+#: django_country_kit/data.py:87
+msgid "Croatia"
+msgstr "Andorra"
+
+#: django_country_kit/data.py:88
+msgid "Cuba"
+msgstr "Angola"
+
+#: django_country_kit/data.py:89
+msgid "Cyprus"
+msgstr "Anguilla"
+
+#: django_country_kit/data.py:90
+msgid "Czech Republic"
+msgstr "Antarktis"
+
+#: django_country_kit/data.py:91
+msgid "Denmark"
+msgstr "Antigua ja Barbuda"
+
+#: django_country_kit/data.py:92
+msgid "Djibouti"
+msgstr "Argentiina"
+
+#: django_country_kit/data.py:93
+msgid "Dominica"
+msgstr "Armenia"
+
+#: django_country_kit/data.py:94
+msgid "Dominican Republic"
+msgstr "Aruba"
+
+#: django_country_kit/data.py:95
+msgid "Ecuador"
+msgstr "Australia"
+
+#: django_country_kit/data.py:96
+msgid "Egypt"
+msgstr "Itävalta"
+
+#: django_country_kit/data.py:97
+msgid "El Salvador"
+msgstr "Azerbaijan"
+
+#: django_country_kit/data.py:98
+msgid "Equatorial Guinea"
+msgstr "Bahama"
+
+#: django_country_kit/data.py:99
+msgid "Eritrea"
+msgstr "Bahrain"
+
+#: django_country_kit/data.py:100
+msgid "Estonia"
+msgstr "Bangladesh"
+
+#: django_country_kit/data.py:101
+msgid "Ethiopia"
+msgstr "Barbados"
+
+#: django_country_kit/data.py:102
+msgid "Falkland Islands (Malvinas)"
+msgstr "Valko-Venäjä"
+
+#: django_country_kit/data.py:103
+msgid "Faroe Islands"
+msgstr "Belgia"
+
+#: django_country_kit/data.py:104
+msgid "Fiji"
+msgstr "Belize"
+
+#: django_country_kit/data.py:105
+msgid "Finland"
+msgstr "Benin"
+
+#: django_country_kit/data.py:106
+msgid "France"
+msgstr "Bermuda"
+
+#: django_country_kit/data.py:107
+msgid "French Guiana"
+msgstr "Bhutan"
+
+#: django_country_kit/data.py:108
+msgid "French Polynesia"
+msgstr "Bolivia"
+
+#: django_country_kit/data.py:109
+msgid "French Southern Territories"
+msgstr "Bosnia ja Hertsegovina"
+
+#: django_country_kit/data.py:110
+msgid "Gabon"
+msgstr "Botswana"
+
+#: django_country_kit/data.py:111
+msgid "Gambia"
+msgstr "Bouvet saari"
+
+#: django_country_kit/data.py:112
+msgid "Georgia"
+msgstr "Brasilia"
+
+#: django_country_kit/data.py:113
+msgid "Germany"
+msgstr "Brittiläinen Intian valtameren alue"
+
+#: django_country_kit/data.py:114
+msgid "Ghana"
+msgstr "Brunei Darussalam"
+
+#: django_country_kit/data.py:115
+msgid "Gibraltar"
+msgstr "Bulgaria"
+
+#: django_country_kit/data.py:116
+msgid "Greece"
+msgstr "Burkina Faso"
+
+#: django_country_kit/data.py:117
+msgid "Greenland"
+msgstr "Burundi"
+
+#: django_country_kit/data.py:118
+msgid "Grenada"
+msgstr "Kambodza"
+
+#: django_country_kit/data.py:119
+msgid "Guadeloupe"
+msgstr "Kamerun"
+
+#: django_country_kit/data.py:120
+msgid "Guam"
+msgstr "Kanada"
+
+#: django_country_kit/data.py:121
+msgid "Guatemala"
+msgstr "Kap Verde"
+
+#: django_country_kit/data.py:122
+msgid "Guernsey"
+msgstr "Kaimaninsaaret"
+
+#: django_country_kit/data.py:123
+msgid "Guinea"
+msgstr "Keski-Afrikan tasavalta"
+
+#: django_country_kit/data.py:124
+msgid "Guinea-Bissau"
+msgstr "Tšad"
+
+#: django_country_kit/data.py:125
+msgid "Guyana"
+msgstr "Chile"
+
+#: django_country_kit/data.py:126
+msgid "Haiti"
+msgstr "Kiina"
+
+#: django_country_kit/data.py:127
+msgid "Heard Island and Mcdonald Islands"
+msgstr "Joulusaari"
+
+#: django_country_kit/data.py:128
+msgid "Holy See (Vatican City State)"
+msgstr "Kookossaaret (Keelingsaaret)"
+
+#: django_country_kit/data.py:129
+msgid "Honduras"
+msgstr "Kolumbia"
+
+#: django_country_kit/data.py:130
+msgid "Hong Kong"
+msgstr "Komorit"
+
+#: django_country_kit/data.py:131
+msgid "Hungary"
+msgstr "Kongo"
+
+#: django_country_kit/data.py:132
+msgid "Iceland"
+msgstr "Kongon demokraattinen tasavalta"
+
+#: django_country_kit/data.py:133
+msgid "India"
+msgstr "Shqipëria"
+
+#: django_country_kit/data.py:134
+msgid "Indonesia"
+msgstr "الجزائر"
+
+#: django_country_kit/data.py:135
+msgid "Iran, Islamic Republic Of"
+msgstr "American Samoa"
+
+#: django_country_kit/data.py:136
+msgid "Iraq"
+msgstr "Andorra"
+
+#: django_country_kit/data.py:137
+msgid "Ireland"
+msgstr "Angola"
+
+#: django_country_kit/data.py:138
+msgid "Isle of Man"
+msgstr "Anguilla"
+
+#: django_country_kit/data.py:139
+msgid "Israel"
+msgstr "Antarctica"
+
+#: django_country_kit/data.py:140
+msgid "Italy"
+msgstr "Antigua and Barbuda"
+
+#: django_country_kit/data.py:141
+msgid "Jamaica"
+msgstr "Argentina"
+
+#: django_country_kit/data.py:142
+msgid "Japan"
+msgstr "Հայաստան"
+
+#: django_country_kit/data.py:143
+msgid "Jersey"
+msgstr "Aruba"
+
+#: django_country_kit/data.py:144
+msgid "Jordan"
+msgstr "Australia"
+
+#: django_country_kit/data.py:145
+msgid "Kazakhstan"
+msgstr "Österreich"
+
+#: django_country_kit/data.py:146
+msgid "Kenya"
+msgstr "Azərbaycan"
+
+#: django_country_kit/data.py:147
+msgid "Kiribati"
+msgstr "The Bahamas"
+
+#: django_country_kit/data.py:148
+msgid "Korea, Democratic People's Republic of"
+msgstr "مملكة البحرين"
+
+#: django_country_kit/data.py:149
+msgid "Korea, Republic of"
+msgstr "বাংলাদেশ"
+
+#: django_country_kit/data.py:150
+msgid "Kuwait"
+msgstr "Barbados"
+
+#: django_country_kit/data.py:151
+msgid "Kyrgyzstan"
+msgstr "Беларусь"
+
+#: django_country_kit/data.py:152
+msgid "Lao People's Democratic Republic"
+msgstr "België"
+
+#: django_country_kit/data.py:153
+msgid "Latvia"
+msgstr "Belize"
+
+#: django_country_kit/data.py:154
+msgid "Lebanon"
+msgstr "Bénin"
+
+#: django_country_kit/data.py:155
+msgid "Lesotho"
+msgstr "Bermuda"
+
+#: django_country_kit/data.py:156
+msgid "Liberia"
+msgstr "འབྲུག་ཡུལ།"
+
+#: django_country_kit/data.py:157
+msgid "Libyan Arab Jamahiriya"
+msgstr "Bolivia"
+
+#: django_country_kit/data.py:158
+msgid "Liechtenstein"
+msgstr "Bosna i Hercegovina"
+
+#: django_country_kit/data.py:159
+msgid "Lithuania"
+msgstr "Botswana"
+
+#: django_country_kit/data.py:160
+msgid "Luxembourg"
+msgstr "Bouvet Island"
+
+#: django_country_kit/data.py:161
+msgid "Macao"
+msgstr "Brasil"
+
+#: django_country_kit/data.py:162
+msgid "Macedonia, The Former Yugoslav Republic of"
+msgstr "British Indian Ocean Territory"
+
+#: django_country_kit/data.py:163
+msgid "Madagascar"
+msgstr "Negara Brunei Darussalam"
+
+#: django_country_kit/data.py:164
+msgid "Malawi"
+msgstr "България"
+
+#: django_country_kit/data.py:165
+msgid "Malaysia"
+msgstr "Burkina Faso"
+
+#: django_country_kit/data.py:166
+msgid "Maldives"
+msgstr "Burundi"
+
+#: django_country_kit/data.py:167
+msgid "Mali"
+msgstr "កម្ពុជា"
+
+#: django_country_kit/data.py:168
+msgid "Malta"
+msgstr "Cameroun"
+
+#: django_country_kit/data.py:169
+msgid "Marshall Islands"
+msgstr "Canada"
+
+#: django_country_kit/data.py:170
+msgid "Martinique"
+msgstr "Cabo Verde"
+
+#: django_country_kit/data.py:171
+msgid "Mauritania"
+msgstr "Cayman Islands"
+
+#: django_country_kit/data.py:172
+msgid "Mauritius"
+msgstr "République centrafricaine"
+
+#: django_country_kit/data.py:173
+msgid "Mayotte"
+msgstr "Tchad"
+
+#: django_country_kit/data.py:174
+msgid "Mexico"
+msgstr "Chile"
+
+#: django_country_kit/data.py:175
+msgid "Micronesia, Federated States of"
+msgstr "中国"
+
+#: django_country_kit/data.py:176
+msgid "Moldova, Republic of"
+msgstr "Christmas Island"
+
+#: django_country_kit/data.py:177
+msgid "Monaco"
+msgstr "Cocos (Keeling) Islands"
+
+#: django_country_kit/data.py:178
+msgid "Mongolia"
+msgstr "Colombia"
+
+#: django_country_kit/data.py:179
+msgid "Montserrat"
+msgstr ""
+
+#: django_country_kit/data.py:180
+msgid "Morocco"
+msgstr ""
+
+#: django_country_kit/data.py:181
+msgid "Mozambique"
+msgstr ""
+
+#: django_country_kit/data.py:182
+msgid "Myanmar"
+msgstr ""
+
+#: django_country_kit/data.py:183
+msgid "Namibia"
+msgstr "Algeria"
+
+#: django_country_kit/data.py:184
+msgid "Nauru"
+msgstr "American Samoa"
+
+#: django_country_kit/data.py:185
+msgid "Nepal"
+msgstr "Andorra"
+
+#: django_country_kit/data.py:186
+msgid "Netherlands"
+msgstr "Angola"
+
+#: django_country_kit/data.py:187
+msgid "Netherlands Antilles"
+msgstr "Anguilla"
+
+#: django_country_kit/data.py:188
+msgid "New Caledonia"
+msgstr "Antarctica"
+
+#: django_country_kit/data.py:189
+msgid "New Zealand"
+msgstr "Antigua and Barbuda"
+
+#: django_country_kit/data.py:190
+msgid "Nicaragua"
+msgstr "Argentina"
+
+#: django_country_kit/data.py:191
+msgid "Niger"
+msgstr "Armenia"
+
+#: django_country_kit/data.py:192
+msgid "Nigeria"
+msgstr "Aruba"
+
+#: django_country_kit/data.py:193
+msgid "Niue"
+msgstr "Australia"
+
+#: django_country_kit/data.py:194
+msgid "Norfolk Island"
+msgstr "Austria"
+
+#: django_country_kit/data.py:195
+msgid "Northern Mariana Islands"
+msgstr "Azerbaijan"
+
+#: django_country_kit/data.py:196
+msgid "Norway"
+msgstr "Bahamas"
+
+#: django_country_kit/data.py:197
+msgid "Oman"
+msgstr "Bahrain"
+
+#: django_country_kit/data.py:198
+msgid "Pakistan"
+msgstr "Bangladesh"
+
+#: django_country_kit/data.py:199
+msgid "Palau"
+msgstr "Barbados"
+
+#: django_country_kit/data.py:200
+msgid "Palestinian Territory, Occupied"
+msgstr "Belarus"
+
+#: django_country_kit/data.py:201
+msgid "Panama"
+msgstr "Belgium"
+
+#: django_country_kit/data.py:202
+msgid "Papua New Guinea"
+msgstr "Belize"
+
+#: django_country_kit/data.py:203
+msgid "Paraguay"
+msgstr "Benin"
+
+#: django_country_kit/data.py:204
+msgid "Peru"
+msgstr "Bermuda"
+
+#: django_country_kit/data.py:205
+msgid "Philippines"
+msgstr "Bhutan"
+
+#: django_country_kit/data.py:206
+msgid "Pitcairn"
+msgstr "Bolivia"
+
+#: django_country_kit/data.py:207
+msgid "Poland"
+msgstr "Bosnia and Herzegovina"
+
+#: django_country_kit/data.py:208
+msgid "Portugal"
+msgstr "Botswana"
+
+#: django_country_kit/data.py:209
+msgid "Puerto Rico"
+msgstr "Bouvet Island"
+
+#: django_country_kit/data.py:210
+msgid "Qatar"
+msgstr "Brazil"
+
+#: django_country_kit/data.py:211
+msgid "Reunion"
+msgstr "British Indian Ocean Territory"
+
+#: django_country_kit/data.py:212
+msgid "Romania"
+msgstr "Brunei Darussalam"
+
+#: django_country_kit/data.py:213
+msgid "Russian Federation"
+msgstr "Bulgaria"
+
+#: django_country_kit/data.py:214
+msgid "Rwanda"
+msgstr "Burkina Faso"
+
+#: django_country_kit/data.py:215
+msgid "Saint Helena"
+msgstr "Burundi"
+
+#: django_country_kit/data.py:216
+msgid "Saint Kitts and Nevis"
+msgstr "Cambodia"
+
+#: django_country_kit/data.py:217
+msgid "Saint Lucia"
+msgstr "Cameroon"
+
+#: django_country_kit/data.py:218
+msgid "Saint Pierre and Miquelon"
+msgstr "Canada"
+
+#: django_country_kit/data.py:219
+msgid "Saint Vincent and the Grenadines"
+msgstr "Cape Verde"
+
+#: django_country_kit/data.py:220
+msgid "Samoa"
+msgstr "Cayman Islands"
+
+#: django_country_kit/data.py:221
+msgid "San Marino"
+msgstr "Central African Republic"
+
+#: django_country_kit/data.py:222
+msgid "Sao Tome and Principe"
+msgstr "Chad"
+
+#: django_country_kit/data.py:223
+msgid "Saudi Arabia"
+msgstr "Chile"
+
+#: django_country_kit/data.py:224
+msgid "Senegal"
+msgstr "China"
+
+#: django_country_kit/data.py:225
+msgid "Serbia and Montenegro"
+msgstr "Christmas Island"
+
+#: django_country_kit/data.py:226
+msgid "Seychelles"
+msgstr "Cocos (Keeling) Islands"
+
+#: django_country_kit/data.py:227
+msgid "Sierra Leone"
+msgstr "Colombia"
+
+#: django_country_kit/data.py:228
+msgid "Singapore"
+msgstr "Comoros"
+
+#: django_country_kit/data.py:229
+msgid "Slovakia"
+msgstr "Congo"
+
+#: django_country_kit/data.py:230
+msgid "Slovenia"
+msgstr "Congo, The Democratic Republic of the"
+
+#: django_country_kit/data.py:231
+msgid "Solomon Islands"
+msgstr "Cook Islands"
+
+#: django_country_kit/data.py:232
+msgid "Somalia"
+msgstr "Costa Rica"
+
+#: django_country_kit/data.py:233
+msgid "South Africa"
+msgstr "American Samoa"
+
+#: django_country_kit/data.py:234
+msgid "South Georgia and the South Sandwich Islands"
+msgstr "Andorra"
+
+#: django_country_kit/data.py:235
+msgid "Spain"
+msgstr "Angola"
+
+#: django_country_kit/data.py:236
+msgid "Sri Lanka"
+msgstr "Anguilla"
+
+#: django_country_kit/data.py:237
+msgid "Sudan"
+msgstr "Antarctica"
+
+#: django_country_kit/data.py:238
+msgid "Suriname"
+msgstr "Antigua and Barbuda"
+
+#: django_country_kit/data.py:239
+msgid "Svalbard and Jan Mayen"
+msgstr "Argentina"
+
+#: django_country_kit/data.py:240
+msgid "Swaziland"
+msgstr "Armenia"
+
+#: django_country_kit/data.py:241
+msgid "Sweden"
+msgstr "Aruba"
+
+#: django_country_kit/data.py:242
+msgid "Switzerland"
+msgstr "Australia"
+
+#: django_country_kit/data.py:243
+msgid "Syrian Arab Republic"
+msgstr "Austria"
+
+#: django_country_kit/data.py:244
+msgid "Taiwan, Province of China"
+msgstr "Azerbaijan"
+
+#: django_country_kit/data.py:245
+msgid "Tajikistan"
+msgstr "Bahamas"
+
+#: django_country_kit/data.py:246
+msgid "Tanzania, United Republic of"
+msgstr "Bahrain"
+
+#: django_country_kit/data.py:247
+msgid "Thailand"
+msgstr "Bangladesh"
+
+#: django_country_kit/data.py:248
+msgid "Timor-Leste"
+msgstr "Barbados"
+
+#: django_country_kit/data.py:249
+msgid "Togo"
+msgstr "Belarus"
+
+#: django_country_kit/data.py:250
+msgid "Tokelau"
+msgstr "Belgium"
+
+#: django_country_kit/data.py:251
+msgid "Tonga"
+msgstr "Belize"
+
+#: django_country_kit/data.py:252
+msgid "Trinidad and Tobago"
+msgstr "Benin"
+
+#: django_country_kit/data.py:253
+msgid "Tunisia"
+msgstr "Bermuda"
+
+#: django_country_kit/data.py:254
+msgid "Türkiye"
+msgstr "Bhutan"
+
+#: django_country_kit/data.py:255
+msgid "Turkmenistan"
+msgstr "Bolivia"
+
+#: django_country_kit/data.py:256
+msgid "Turks and Caicos Islands"
+msgstr "Bosnia and Herzegovina"
+
+#: django_country_kit/data.py:257
+msgid "Tuvalu"
+msgstr "Botswana"
+
+#: django_country_kit/data.py:258
+msgid "Uganda"
+msgstr "Bouvet Island"
+
+#: django_country_kit/data.py:259
+msgid "Ukraine"
+msgstr "Brazil"
+
+#: django_country_kit/data.py:260
+msgid "United Arab Emirates"
+msgstr "British Indian Ocean Territory"
+
+#: django_country_kit/data.py:261
+msgid "United Kingdom"
+msgstr "Brunei Darussalam"
+
+#: django_country_kit/data.py:262
+msgid "United States"
+msgstr "Bulgaria"
+
+#: django_country_kit/data.py:263
+msgid "United States Minor Outlying Islands"
+msgstr "Burkina Faso"
+
+#: django_country_kit/data.py:264
+msgid "Uruguay"
+msgstr "Burundi"
+
+#: django_country_kit/data.py:265
+msgid "Uzbekistan"
+msgstr "Cambodia"
+
+#: django_country_kit/data.py:266
+msgid "Vanuatu"
+msgstr "Cameroon"
+
+#: django_country_kit/data.py:267
+msgid "Venezuela"
+msgstr "Canada"
+
+#: django_country_kit/data.py:268
+msgid "Viet Nam"
+msgstr "Cape Verde"
+
+#: django_country_kit/data.py:269
+msgid "Virgin Islands, British"
+msgstr "Cayman Islands"
+
+#: django_country_kit/data.py:270
+msgid "Virgin Islands, U.S."
+msgstr "Central African Republic"
+
+#: django_country_kit/data.py:271
+msgid "Wallis and Futuna"
+msgstr "Chad"
+
+#: django_country_kit/data.py:272
+msgid "Western Sahara"
+msgstr "Chile"
+
+#: django_country_kit/data.py:273
+msgid "Yemen"
+msgstr "China"
+
+#: django_country_kit/data.py:274
+msgid "Zambia"
+msgstr "Christmas Island"
+
+#: django_country_kit/data.py:275
+msgid "Zimbabwe"
+msgstr "Cocos (Keeling) Islands"
diff --git a/django_country_kit/locale/nl/LC_MESSAGES/django.po b/django_country_kit/locale/nl/LC_MESSAGES/django.po
new file mode 100644
index 0000000..7f6a6f7
--- /dev/null
+++ b/django_country_kit/locale/nl/LC_MESSAGES/django.po
@@ -0,0 +1,990 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR , YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2024-01-26 10:21+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: LANGUAGE \n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+#: django_country_kit/data.py:33
+msgid "Afghanistan"
+msgstr ""
+
+#: django_country_kit/data.py:34
+msgid "Åland Islands"
+msgstr ""
+
+#: django_country_kit/data.py:35
+msgid "Albania"
+msgstr ""
+
+#: django_country_kit/data.py:36
+msgid "Algeria"
+msgstr ""
+
+#: django_country_kit/data.py:37
+msgid "American Samoa"
+msgstr ""
+
+#: django_country_kit/data.py:38
+msgid "Andorra"
+msgstr ""
+
+#: django_country_kit/data.py:39
+msgid "Angola"
+msgstr ""
+
+#: django_country_kit/data.py:40
+msgid "Anguilla"
+msgstr ""
+
+#: django_country_kit/data.py:41
+msgid "Antarctica"
+msgstr ""
+
+#: django_country_kit/data.py:42
+msgid "Antigua and Barbuda"
+msgstr ""
+
+#: django_country_kit/data.py:43
+msgid "Argentina"
+msgstr ""
+
+#: django_country_kit/data.py:44
+msgid "Armenia"
+msgstr ""
+
+#: django_country_kit/data.py:45
+msgid "Aruba"
+msgstr ""
+
+#: django_country_kit/data.py:46
+msgid "Australia"
+msgstr ""
+
+#: django_country_kit/data.py:47
+msgid "Austria"
+msgstr ""
+
+#: django_country_kit/data.py:48
+msgid "Azerbaijan"
+msgstr ""
+
+#: django_country_kit/data.py:49
+msgid "Bahamas"
+msgstr ""
+
+#: django_country_kit/data.py:50
+msgid "Bahrain"
+msgstr ""
+
+#: django_country_kit/data.py:51
+msgid "Bangladesh"
+msgstr ""
+
+#: django_country_kit/data.py:52
+msgid "Barbados"
+msgstr ""
+
+#: django_country_kit/data.py:53
+msgid "Belarus"
+msgstr ""
+
+#: django_country_kit/data.py:54
+msgid "Belgium"
+msgstr ""
+
+#: django_country_kit/data.py:55
+msgid "Belize"
+msgstr ""
+
+#: django_country_kit/data.py:56
+msgid "Benin"
+msgstr ""
+
+#: django_country_kit/data.py:57
+msgid "Bermuda"
+msgstr ""
+
+#: django_country_kit/data.py:58
+msgid "Bhutan"
+msgstr ""
+
+#: django_country_kit/data.py:59
+msgid "Bolivia"
+msgstr ""
+
+#: django_country_kit/data.py:60
+msgid "Bosnia and Herzegovina"
+msgstr ""
+
+#: django_country_kit/data.py:61
+msgid "Botswana"
+msgstr ""
+
+#: django_country_kit/data.py:62
+msgid "Bouvet Island"
+msgstr ""
+
+#: django_country_kit/data.py:63
+msgid "Brazil"
+msgstr ""
+
+#: django_country_kit/data.py:64
+msgid "British Indian Ocean Territory"
+msgstr ""
+
+#: django_country_kit/data.py:65
+msgid "Brunei Darussalam"
+msgstr ""
+
+#: django_country_kit/data.py:66
+msgid "Bulgaria"
+msgstr ""
+
+#: django_country_kit/data.py:67
+msgid "Burkina Faso"
+msgstr ""
+
+#: django_country_kit/data.py:68
+msgid "Burundi"
+msgstr ""
+
+#: django_country_kit/data.py:69
+msgid "Cambodia"
+msgstr ""
+
+#: django_country_kit/data.py:70
+msgid "Cameroon"
+msgstr ""
+
+#: django_country_kit/data.py:71
+msgid "Canada"
+msgstr ""
+
+#: django_country_kit/data.py:72
+msgid "Cape Verde"
+msgstr ""
+
+#: django_country_kit/data.py:73
+msgid "Cayman Islands"
+msgstr ""
+
+#: django_country_kit/data.py:74
+msgid "Central African Republic"
+msgstr ""
+
+#: django_country_kit/data.py:75
+msgid "Chad"
+msgstr ""
+
+#: django_country_kit/data.py:76
+msgid "Chile"
+msgstr ""
+
+#: django_country_kit/data.py:77
+msgid "China"
+msgstr ""
+
+#: django_country_kit/data.py:78
+msgid "Christmas Island"
+msgstr ""
+
+#: django_country_kit/data.py:79
+msgid "Cocos (Keeling) Islands"
+msgstr ""
+
+#: django_country_kit/data.py:80
+msgid "Colombia"
+msgstr ""
+
+#: django_country_kit/data.py:81
+msgid "Comoros"
+msgstr ""
+
+#: django_country_kit/data.py:82
+msgid "Congo"
+msgstr ""
+
+#: django_country_kit/data.py:83
+msgid "Congo, The Democratic Republic of the"
+msgstr ""
+
+#: django_country_kit/data.py:84
+msgid "Cook Islands"
+msgstr ""
+
+#: django_country_kit/data.py:85
+msgid "Costa Rica"
+msgstr ""
+
+#: django_country_kit/data.py:86
+msgid "Cote D'Ivoire"
+msgstr ""
+
+#: django_country_kit/data.py:87
+msgid "Croatia"
+msgstr ""
+
+#: django_country_kit/data.py:88
+msgid "Cuba"
+msgstr ""
+
+#: django_country_kit/data.py:89
+msgid "Cyprus"
+msgstr ""
+
+#: django_country_kit/data.py:90
+msgid "Czech Republic"
+msgstr ""
+
+#: django_country_kit/data.py:91
+msgid "Denmark"
+msgstr ""
+
+#: django_country_kit/data.py:92
+msgid "Djibouti"
+msgstr ""
+
+#: django_country_kit/data.py:93
+msgid "Dominica"
+msgstr ""
+
+#: django_country_kit/data.py:94
+msgid "Dominican Republic"
+msgstr ""
+
+#: django_country_kit/data.py:95
+msgid "Ecuador"
+msgstr ""
+
+#: django_country_kit/data.py:96
+msgid "Egypt"
+msgstr ""
+
+#: django_country_kit/data.py:97
+msgid "El Salvador"
+msgstr ""
+
+#: django_country_kit/data.py:98
+msgid "Equatorial Guinea"
+msgstr ""
+
+#: django_country_kit/data.py:99
+msgid "Eritrea"
+msgstr ""
+
+#: django_country_kit/data.py:100
+msgid "Estonia"
+msgstr ""
+
+#: django_country_kit/data.py:101
+msgid "Ethiopia"
+msgstr ""
+
+#: django_country_kit/data.py:102
+msgid "Falkland Islands (Malvinas)"
+msgstr ""
+
+#: django_country_kit/data.py:103
+msgid "Faroe Islands"
+msgstr ""
+
+#: django_country_kit/data.py:104
+msgid "Fiji"
+msgstr ""
+
+#: django_country_kit/data.py:105
+msgid "Finland"
+msgstr ""
+
+#: django_country_kit/data.py:106
+msgid "France"
+msgstr ""
+
+#: django_country_kit/data.py:107
+msgid "French Guiana"
+msgstr ""
+
+#: django_country_kit/data.py:108
+msgid "French Polynesia"
+msgstr ""
+
+#: django_country_kit/data.py:109
+msgid "French Southern Territories"
+msgstr ""
+
+#: django_country_kit/data.py:110
+msgid "Gabon"
+msgstr ""
+
+#: django_country_kit/data.py:111
+msgid "Gambia"
+msgstr ""
+
+#: django_country_kit/data.py:112
+msgid "Georgia"
+msgstr ""
+
+#: django_country_kit/data.py:113
+msgid "Germany"
+msgstr ""
+
+#: django_country_kit/data.py:114
+msgid "Ghana"
+msgstr ""
+
+#: django_country_kit/data.py:115
+msgid "Gibraltar"
+msgstr ""
+
+#: django_country_kit/data.py:116
+msgid "Greece"
+msgstr ""
+
+#: django_country_kit/data.py:117
+msgid "Greenland"
+msgstr ""
+
+#: django_country_kit/data.py:118
+msgid "Grenada"
+msgstr ""
+
+#: django_country_kit/data.py:119
+msgid "Guadeloupe"
+msgstr ""
+
+#: django_country_kit/data.py:120
+msgid "Guam"
+msgstr ""
+
+#: django_country_kit/data.py:121
+msgid "Guatemala"
+msgstr ""
+
+#: django_country_kit/data.py:122
+msgid "Guernsey"
+msgstr ""
+
+#: django_country_kit/data.py:123
+msgid "Guinea"
+msgstr ""
+
+#: django_country_kit/data.py:124
+msgid "Guinea-Bissau"
+msgstr ""
+
+#: django_country_kit/data.py:125
+msgid "Guyana"
+msgstr ""
+
+#: django_country_kit/data.py:126
+msgid "Haiti"
+msgstr ""
+
+#: django_country_kit/data.py:127
+msgid "Heard Island and Mcdonald Islands"
+msgstr ""
+
+#: django_country_kit/data.py:128
+msgid "Holy See (Vatican City State)"
+msgstr ""
+
+#: django_country_kit/data.py:129
+msgid "Honduras"
+msgstr ""
+
+#: django_country_kit/data.py:130
+msgid "Hong Kong"
+msgstr ""
+
+#: django_country_kit/data.py:131
+msgid "Hungary"
+msgstr ""
+
+#: django_country_kit/data.py:132
+msgid "Iceland"
+msgstr ""
+
+#: django_country_kit/data.py:133
+msgid "India"
+msgstr ""
+
+#: django_country_kit/data.py:134
+msgid "Indonesia"
+msgstr ""
+
+#: django_country_kit/data.py:135
+msgid "Iran, Islamic Republic Of"
+msgstr ""
+
+#: django_country_kit/data.py:136
+msgid "Iraq"
+msgstr ""
+
+#: django_country_kit/data.py:137
+msgid "Ireland"
+msgstr ""
+
+#: django_country_kit/data.py:138
+msgid "Isle of Man"
+msgstr ""
+
+#: django_country_kit/data.py:139
+msgid "Israel"
+msgstr ""
+
+#: django_country_kit/data.py:140
+msgid "Italy"
+msgstr ""
+
+#: django_country_kit/data.py:141
+msgid "Jamaica"
+msgstr ""
+
+#: django_country_kit/data.py:142
+msgid "Japan"
+msgstr ""
+
+#: django_country_kit/data.py:143
+msgid "Jersey"
+msgstr ""
+
+#: django_country_kit/data.py:144
+msgid "Jordan"
+msgstr ""
+
+#: django_country_kit/data.py:145
+msgid "Kazakhstan"
+msgstr ""
+
+#: django_country_kit/data.py:146
+msgid "Kenya"
+msgstr ""
+
+#: django_country_kit/data.py:147
+msgid "Kiribati"
+msgstr ""
+
+#: django_country_kit/data.py:148
+msgid "Korea, Democratic People's Republic of"
+msgstr ""
+
+#: django_country_kit/data.py:149
+msgid "Korea, Republic of"
+msgstr ""
+
+#: django_country_kit/data.py:150
+msgid "Kuwait"
+msgstr ""
+
+#: django_country_kit/data.py:151
+msgid "Kyrgyzstan"
+msgstr ""
+
+#: django_country_kit/data.py:152
+msgid "Lao People's Democratic Republic"
+msgstr ""
+
+#: django_country_kit/data.py:153
+msgid "Latvia"
+msgstr ""
+
+#: django_country_kit/data.py:154
+msgid "Lebanon"
+msgstr ""
+
+#: django_country_kit/data.py:155
+msgid "Lesotho"
+msgstr ""
+
+#: django_country_kit/data.py:156
+msgid "Liberia"
+msgstr ""
+
+#: django_country_kit/data.py:157
+msgid "Libyan Arab Jamahiriya"
+msgstr ""
+
+#: django_country_kit/data.py:158
+msgid "Liechtenstein"
+msgstr ""
+
+#: django_country_kit/data.py:159
+msgid "Lithuania"
+msgstr ""
+
+#: django_country_kit/data.py:160
+msgid "Luxembourg"
+msgstr ""
+
+#: django_country_kit/data.py:161
+msgid "Macao"
+msgstr ""
+
+#: django_country_kit/data.py:162
+msgid "Macedonia, The Former Yugoslav Republic of"
+msgstr ""
+
+#: django_country_kit/data.py:163
+msgid "Madagascar"
+msgstr ""
+
+#: django_country_kit/data.py:164
+msgid "Malawi"
+msgstr ""
+
+#: django_country_kit/data.py:165
+msgid "Malaysia"
+msgstr ""
+
+#: django_country_kit/data.py:166
+msgid "Maldives"
+msgstr ""
+
+#: django_country_kit/data.py:167
+msgid "Mali"
+msgstr ""
+
+#: django_country_kit/data.py:168
+msgid "Malta"
+msgstr ""
+
+#: django_country_kit/data.py:169
+msgid "Marshall Islands"
+msgstr ""
+
+#: django_country_kit/data.py:170
+msgid "Martinique"
+msgstr ""
+
+#: django_country_kit/data.py:171
+msgid "Mauritania"
+msgstr ""
+
+#: django_country_kit/data.py:172
+msgid "Mauritius"
+msgstr ""
+
+#: django_country_kit/data.py:173
+msgid "Mayotte"
+msgstr ""
+
+#: django_country_kit/data.py:174
+msgid "Mexico"
+msgstr ""
+
+#: django_country_kit/data.py:175
+msgid "Micronesia, Federated States of"
+msgstr ""
+
+#: django_country_kit/data.py:176
+msgid "Moldova, Republic of"
+msgstr ""
+
+#: django_country_kit/data.py:177
+msgid "Monaco"
+msgstr ""
+
+#: django_country_kit/data.py:178
+msgid "Mongolia"
+msgstr ""
+
+#: django_country_kit/data.py:179
+msgid "Montserrat"
+msgstr ""
+
+#: django_country_kit/data.py:180
+msgid "Morocco"
+msgstr ""
+
+#: django_country_kit/data.py:181
+msgid "Mozambique"
+msgstr ""
+
+#: django_country_kit/data.py:182
+msgid "Myanmar"
+msgstr ""
+
+#: django_country_kit/data.py:183
+msgid "Namibia"
+msgstr ""
+
+#: django_country_kit/data.py:184
+msgid "Nauru"
+msgstr ""
+
+#: django_country_kit/data.py:185
+msgid "Nepal"
+msgstr ""
+
+#: django_country_kit/data.py:186
+msgid "Netherlands"
+msgstr ""
+
+#: django_country_kit/data.py:187
+msgid "Netherlands Antilles"
+msgstr ""
+
+#: django_country_kit/data.py:188
+msgid "New Caledonia"
+msgstr ""
+
+#: django_country_kit/data.py:189
+msgid "New Zealand"
+msgstr ""
+
+#: django_country_kit/data.py:190
+msgid "Nicaragua"
+msgstr ""
+
+#: django_country_kit/data.py:191
+msgid "Niger"
+msgstr ""
+
+#: django_country_kit/data.py:192
+msgid "Nigeria"
+msgstr ""
+
+#: django_country_kit/data.py:193
+msgid "Niue"
+msgstr ""
+
+#: django_country_kit/data.py:194
+msgid "Norfolk Island"
+msgstr ""
+
+#: django_country_kit/data.py:195
+msgid "Northern Mariana Islands"
+msgstr ""
+
+#: django_country_kit/data.py:196
+msgid "Norway"
+msgstr ""
+
+#: django_country_kit/data.py:197
+msgid "Oman"
+msgstr ""
+
+#: django_country_kit/data.py:198
+msgid "Pakistan"
+msgstr ""
+
+#: django_country_kit/data.py:199
+msgid "Palau"
+msgstr ""
+
+#: django_country_kit/data.py:200
+msgid "Palestinian Territory, Occupied"
+msgstr ""
+
+#: django_country_kit/data.py:201
+msgid "Panama"
+msgstr ""
+
+#: django_country_kit/data.py:202
+msgid "Papua New Guinea"
+msgstr ""
+
+#: django_country_kit/data.py:203
+msgid "Paraguay"
+msgstr ""
+
+#: django_country_kit/data.py:204
+msgid "Peru"
+msgstr ""
+
+#: django_country_kit/data.py:205
+msgid "Philippines"
+msgstr ""
+
+#: django_country_kit/data.py:206
+msgid "Pitcairn"
+msgstr ""
+
+#: django_country_kit/data.py:207
+msgid "Poland"
+msgstr ""
+
+#: django_country_kit/data.py:208
+msgid "Portugal"
+msgstr ""
+
+#: django_country_kit/data.py:209
+msgid "Puerto Rico"
+msgstr ""
+
+#: django_country_kit/data.py:210
+msgid "Qatar"
+msgstr ""
+
+#: django_country_kit/data.py:211
+msgid "Reunion"
+msgstr ""
+
+#: django_country_kit/data.py:212
+msgid "Romania"
+msgstr ""
+
+#: django_country_kit/data.py:213
+msgid "Russian Federation"
+msgstr ""
+
+#: django_country_kit/data.py:214
+msgid "Rwanda"
+msgstr ""
+
+#: django_country_kit/data.py:215
+msgid "Saint Helena"
+msgstr ""
+
+#: django_country_kit/data.py:216
+msgid "Saint Kitts and Nevis"
+msgstr ""
+
+#: django_country_kit/data.py:217
+msgid "Saint Lucia"
+msgstr ""
+
+#: django_country_kit/data.py:218
+msgid "Saint Pierre and Miquelon"
+msgstr ""
+
+#: django_country_kit/data.py:219
+msgid "Saint Vincent and the Grenadines"
+msgstr ""
+
+#: django_country_kit/data.py:220
+msgid "Samoa"
+msgstr ""
+
+#: django_country_kit/data.py:221
+msgid "San Marino"
+msgstr ""
+
+#: django_country_kit/data.py:222
+msgid "Sao Tome and Principe"
+msgstr ""
+
+#: django_country_kit/data.py:223
+msgid "Saudi Arabia"
+msgstr ""
+
+#: django_country_kit/data.py:224
+msgid "Senegal"
+msgstr ""
+
+#: django_country_kit/data.py:225
+msgid "Serbia and Montenegro"
+msgstr ""
+
+#: django_country_kit/data.py:226
+msgid "Seychelles"
+msgstr ""
+
+#: django_country_kit/data.py:227
+msgid "Sierra Leone"
+msgstr ""
+
+#: django_country_kit/data.py:228
+msgid "Singapore"
+msgstr ""
+
+#: django_country_kit/data.py:229
+msgid "Slovakia"
+msgstr ""
+
+#: django_country_kit/data.py:230
+msgid "Slovenia"
+msgstr ""
+
+#: django_country_kit/data.py:231
+msgid "Solomon Islands"
+msgstr ""
+
+#: django_country_kit/data.py:232
+msgid "Somalia"
+msgstr ""
+
+#: django_country_kit/data.py:233
+msgid "South Africa"
+msgstr ""
+
+#: django_country_kit/data.py:234
+msgid "South Georgia and the South Sandwich Islands"
+msgstr ""
+
+#: django_country_kit/data.py:235
+msgid "Spain"
+msgstr ""
+
+#: django_country_kit/data.py:236
+msgid "Sri Lanka"
+msgstr ""
+
+#: django_country_kit/data.py:237
+msgid "Sudan"
+msgstr ""
+
+#: django_country_kit/data.py:238
+msgid "Suriname"
+msgstr ""
+
+#: django_country_kit/data.py:239
+msgid "Svalbard and Jan Mayen"
+msgstr ""
+
+#: django_country_kit/data.py:240
+msgid "Swaziland"
+msgstr ""
+
+#: django_country_kit/data.py:241
+msgid "Sweden"
+msgstr ""
+
+#: django_country_kit/data.py:242
+msgid "Switzerland"
+msgstr ""
+
+#: django_country_kit/data.py:243
+msgid "Syrian Arab Republic"
+msgstr ""
+
+#: django_country_kit/data.py:244
+msgid "Taiwan, Province of China"
+msgstr ""
+
+#: django_country_kit/data.py:245
+msgid "Tajikistan"
+msgstr ""
+
+#: django_country_kit/data.py:246
+msgid "Tanzania, United Republic of"
+msgstr ""
+
+#: django_country_kit/data.py:247
+msgid "Thailand"
+msgstr ""
+
+#: django_country_kit/data.py:248
+msgid "Timor-Leste"
+msgstr ""
+
+#: django_country_kit/data.py:249
+msgid "Togo"
+msgstr ""
+
+#: django_country_kit/data.py:250
+msgid "Tokelau"
+msgstr ""
+
+#: django_country_kit/data.py:251
+msgid "Tonga"
+msgstr ""
+
+#: django_country_kit/data.py:252
+msgid "Trinidad and Tobago"
+msgstr ""
+
+#: django_country_kit/data.py:253
+msgid "Tunisia"
+msgstr ""
+
+#: django_country_kit/data.py:254
+msgid "Türkiye"
+msgstr ""
+
+#: django_country_kit/data.py:255
+msgid "Turkmenistan"
+msgstr ""
+
+#: django_country_kit/data.py:256
+msgid "Turks and Caicos Islands"
+msgstr ""
+
+#: django_country_kit/data.py:257
+msgid "Tuvalu"
+msgstr ""
+
+#: django_country_kit/data.py:258
+msgid "Uganda"
+msgstr ""
+
+#: django_country_kit/data.py:259
+msgid "Ukraine"
+msgstr ""
+
+#: django_country_kit/data.py:260
+msgid "United Arab Emirates"
+msgstr ""
+
+#: django_country_kit/data.py:261
+msgid "United Kingdom"
+msgstr ""
+
+#: django_country_kit/data.py:262
+msgid "United States"
+msgstr ""
+
+#: django_country_kit/data.py:263
+msgid "United States Minor Outlying Islands"
+msgstr ""
+
+#: django_country_kit/data.py:264
+msgid "Uruguay"
+msgstr ""
+
+#: django_country_kit/data.py:265
+msgid "Uzbekistan"
+msgstr ""
+
+#: django_country_kit/data.py:266
+msgid "Vanuatu"
+msgstr ""
+
+#: django_country_kit/data.py:267
+msgid "Venezuela"
+msgstr ""
+
+#: django_country_kit/data.py:268
+msgid "Viet Nam"
+msgstr ""
+
+#: django_country_kit/data.py:269
+msgid "Virgin Islands, British"
+msgstr ""
+
+#: django_country_kit/data.py:270
+msgid "Virgin Islands, U.S."
+msgstr ""
+
+#: django_country_kit/data.py:271
+msgid "Wallis and Futuna"
+msgstr ""
+
+#: django_country_kit/data.py:272
+msgid "Western Sahara"
+msgstr ""
+
+#: django_country_kit/data.py:273
+msgid "Yemen"
+msgstr ""
+
+#: django_country_kit/data.py:274
+msgid "Zambia"
+msgstr ""
+
+#: django_country_kit/data.py:275
+msgid "Zimbabwe"
+msgstr ""
diff --git a/django_country_kit/models.py b/django_country_kit/models.py
new file mode 100644
index 0000000..e69de29
diff --git a/django_country_kit/tests.py b/django_country_kit/tests.py
new file mode 100644
index 0000000..a384817
--- /dev/null
+++ b/django_country_kit/tests.py
@@ -0,0 +1,129 @@
+"""
+Module containing tests for country-related functionality in your Django app.
+
+This module defines test classes for the 'CountryField' and 'CountryWidget'
+components in your Django app. It includes tests for the 'CountryField' model field
+and the 'CountryWidget' form widget, including the behavior when using the
+'OVERRIDE_COUNTRIES' and 'EXCLUDE_COUNTRIES' settings.
+
+Usage:
+- Include this module in your Django app's 'tests' package.
+- Run the tests using the Django test runner.
+
+Example:
+ # Run tests using the Django test runner:
+ python manage.py test your_app.tests
+
+Note:
+ Make sure to set up the appropriate logging configuration and include this module
+ in your project's tests configuration.
+
+For more information, see Django documentation on testing:
+https://docs.djangoproject.com/en/3.2/topics/testing/
+"""
+
+import logging
+
+from django.conf import settings
+from django.core import exceptions
+from django.test import TestCase, override_settings
+
+from .data import DATA
+from .fields import CountryField, MultiSelectList
+
+logger = logging.getLogger(__name__)
+
+
+class CountryFieldTests(TestCase):
+ """
+ Test class for the 'CountryField' model field.
+
+ Methods:
+ - test_country_field_max_length(): Test that max_length is set to the length of the longest country code.
+ - test_country_field_choices(): Test that choices are populated from COUNTRIES.
+ - test_country_field_override_countries(): Test behavior when using OVERRIDE_COUNTRIES setting.
+ - test_country_field_exclude_countries(): Test behavior when using EXCLUDE_COUNTRIES setting.
+ - test_country_field_get_choices_method(): Test the overridden get_choices method.
+ - test_country_field_validate_method(): Test the overridden validate method for multiple selection.
+ """
+
+ def test_country_field_max_length(self):
+ """
+ Test that max_length is set to the length of the longest country code.
+ """
+ field = CountryField()
+ max_length = max(len(code) for code in field.countries)
+ self.assertEqual(field.max_length, max_length)
+ logger.info("test_country_field_max_length ✓")
+
+ def test_country_field_choices(self):
+ """
+ Test that choices are populated from COUNTRIES.
+ """
+ field = CountryField()
+ choices = field.choices
+ self.assertEqual(len(choices), len(field.countries))
+ logger.info("test_country_field_choices ✓")
+
+ @override_settings(OVERRIDE_COUNTRIES={"US": {"name": "United States", "alpha3": "USA"}})
+ def test_country_field_override_countries(self):
+ """
+ Test behavior when using OVERRIDE_COUNTRIES setting.
+ """
+ field = CountryField()
+ self.assertEqual(len(field.choices), 1)
+ logger.info("test_country_field_override_countries ✓")
+
+ @override_settings(EXCLUDE_COUNTRIES=["US", "CA"])
+ def test_country_field_exclude_countries(self):
+ """
+ Test behavior when using EXCLUDE_COUNTRIES setting.
+ """
+ field = CountryField()
+ self.assertEqual(len(field.choices), len(DATA) - len(settings.EXCLUDE_COUNTRIES))
+ logger.info("test_country_field_exclude_countries ✓")
+
+ def test_country_field_get_choices_method(self):
+ """
+ Test the overridden get_choices method.
+ """
+ field = CountryField()
+ choices = field.choices
+ self.assertIsInstance(choices, list)
+ logger.info("test_country_field_get_choices_method ✓")
+
+ def test_country_field_validate_method(self):
+ """
+ Test the overridden validate method for multiple selection.
+ """
+ field = CountryField(multiple=True)
+ # Test valid selection
+ valid_value = ["US", "CA"]
+ try:
+ field.validate(valid_value, None)
+ except exceptions.ValidationError:
+ self.fail("Validation failed for valid multiple selection.")
+ # Test invalid selection
+ invalid_value = ["XX"]
+ with self.assertRaises(exceptions.ValidationError):
+ field.validate(invalid_value, None)
+ logger.info("test_country_field_validate_method ✓")
+
+
+class MultiSelectListTests(TestCase):
+ """
+ Test class for the 'MultiSelectList' custom list type.
+
+ Methods:
+ - test_multiselect_list_string_representation(): Test string representation of MultiSelectList.
+ """
+
+ def test_multiselect_list_string_representation(self):
+ """
+ Test string representation of MultiSelectList.
+ """
+ choices = {"US": "United States", "CA": "Canada"}
+ value = ["US", "CA"]
+ multi_select_list = MultiSelectList(choices, value)
+ self.assertEqual(str(multi_select_list), "United States, Canada")
+ logger.info("test_multiselect_list_string_representation ✓")
diff --git a/django_country_kit/widgets.py b/django_country_kit/widgets.py
new file mode 100644
index 0000000..ea6adac
--- /dev/null
+++ b/django_country_kit/widgets.py
@@ -0,0 +1,68 @@
+"""
+Module defining a Django form widget 'CountryWidget' with internationalization support.
+
+This module defines the 'CountryWidget' class, a subclass of Django's 'Select' form widget.
+It is designed for rendering a dropdown list of countries with internationalization support.
+
+Usage:
+- Include this module in your Django app.
+- Use the 'CountryWidget' in your Django forms for rendering country selection.
+
+Example:
+ # In your Django app's forms.py file:
+ from django import forms
+ from .fields import Country
+ from .widgets import CountryWidget
+
+ class ExampleForm(forms.Form):
+ country = forms.ChoiceField(widget=CountryWidget())
+
+Attributes:
+ - CountryWidget (class): A Django form widget for rendering a dropdown list of countries.
+ It populates choices based on the 'COUNTRIES' data.
+
+Note:
+ Make sure to include this module in your project and set up internationalization in your Django app.
+
+For more information, see Django documentation on forms and form widgets:
+https://docs.djangoproject.com/en/5/topics/forms/
+https://docs.djangoproject.com/en/5/ref/forms/widgets/
+"""
+
+from django import forms
+
+from .base import Country
+
+
+class CountrySelectMixin:
+ """
+ A mixin class to handle common functionalities for country select widgets.
+ """
+
+ def __init__(self, attrs=None):
+ """
+ Initialize the widget.
+
+ Parameters:
+ - attrs (dict): Additional attributes for the widget.
+ """
+ # Ensure attrs is a dictionary
+ attrs = attrs or {}
+
+ # Populate choices based on COUNTRIES
+ self.choices = ((code, data['name']) for code, data in Country().countries_data.items())
+
+ # Use the superclass to initialize the widget
+ super().__init__(attrs=attrs, choices=self.choices)
+
+
+class CountryWidget(CountrySelectMixin, forms.Select):
+ """
+ A Django form widget for rendering a dropdown list of countries.
+ """
+
+
+class MultipleCountryWidget(CountrySelectMixin, forms.SelectMultiple):
+ """
+ A Django form widget for rendering a dropdown list of countries.
+ """
diff --git a/locale/nl/LC_MESSAGES/django.po b/locale/nl/LC_MESSAGES/django.po
new file mode 100644
index 0000000..9496327
--- /dev/null
+++ b/locale/nl/LC_MESSAGES/django.po
@@ -0,0 +1,30 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR , YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2024-01-26 10:21+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: LANGUAGE \n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+#: project/settings.py:158
+msgid "Afghanistan"
+msgstr ""
+
+#: project/settings.py:159
+msgid "Åland Islands"
+msgstr ""
+
+#: project/settings.py:160
+msgid "Albania"
+msgstr ""
diff --git a/manage.py b/manage.py
new file mode 100755
index 0000000..e170f6b
--- /dev/null
+++ b/manage.py
@@ -0,0 +1,22 @@
+#!/usr/bin/env python
+"""Django's command-line utility for administrative tasks."""
+import os
+import sys
+
+
+def main():
+ """Run administrative tasks."""
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")
+ try:
+ from django.core.management import execute_from_command_line
+ except ImportError as exc:
+ raise ImportError(
+ "Couldn't import Django. Are you sure it's installed and "
+ "available on your PYTHONPATH environment variable? Did you "
+ "forget to activate a virtual environment?"
+ ) from exc
+ execute_from_command_line(sys.argv)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/project/__init__.py b/project/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/project/asgi.py b/project/asgi.py
new file mode 100644
index 0000000..486c89b
--- /dev/null
+++ b/project/asgi.py
@@ -0,0 +1,16 @@
+"""
+ASGI config for project project.
+
+It exposes the ASGI callable as a module-level variable named ``application``.
+
+For more information on this file, see
+https://docs.djangoproject.com/en/4.1/howto/deployment/asgi/
+"""
+
+import os
+
+from django.core.asgi import get_asgi_application
+
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")
+
+application = get_asgi_application()
diff --git a/project/settings.py b/project/settings.py
new file mode 100644
index 0000000..49ac2aa
--- /dev/null
+++ b/project/settings.py
@@ -0,0 +1,154 @@
+"""
+Django settings for project project.
+
+Generated by 'django-admin startproject' using Django 4.1.4.
+
+For more information on this file, see
+https://docs.djangoproject.com/en/4.1/topics/settings/
+
+For the full list of settings and their values, see
+https://docs.djangoproject.com/en/4.1/ref/settings/
+"""
+import os
+import sys
+from pathlib import Path
+
+# Build paths inside the project like this: BASE_DIR / 'subdir'.
+BASE_DIR = Path(__file__).resolve().parent.parent
+
+
+# Quick-start development settings - unsuitable for production
+# See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/
+
+# SECURITY WARNING: keep the secret key used in production secret!
+SECRET_KEY = "django-insecure-68)d^nkcc)$$-l%s*!z=y+pp6ec#)mfco!(7_kz18io=q-p@!g"
+
+# SECURITY WARNING: don't run with debug turned on in production!
+DEBUG = True
+
+ALLOWED_HOSTS = []
+
+
+# Application definition
+
+INSTALLED_APPS = [
+ "django.contrib.admin",
+ "django.contrib.auth",
+ "django.contrib.contenttypes",
+ "django.contrib.sessions",
+ "django.contrib.messages",
+ "django.contrib.staticfiles",
+ "dev",
+ "django_country_kit"
+]
+
+MIDDLEWARE = [
+ "django.middleware.security.SecurityMiddleware",
+ "django.contrib.sessions.middleware.SessionMiddleware",
+ "django.middleware.common.CommonMiddleware",
+ "django.middleware.csrf.CsrfViewMiddleware",
+ "django.contrib.auth.middleware.AuthenticationMiddleware",
+ "django.contrib.messages.middleware.MessageMiddleware",
+ "django.middleware.clickjacking.XFrameOptionsMiddleware",
+]
+
+ROOT_URLCONF = "project.urls"
+
+TEMPLATES = [
+ {
+ "BACKEND": "django.template.backends.django.DjangoTemplates",
+ "DIRS": [],
+ "APP_DIRS": True,
+ "OPTIONS": {
+ "context_processors": [
+ "django.template.context_processors.debug",
+ "django.template.context_processors.request",
+ "django.contrib.auth.context_processors.auth",
+ "django.contrib.messages.context_processors.messages",
+ ],
+ },
+ },
+]
+
+WSGI_APPLICATION = "project.wsgi.application"
+
+
+# Database
+# https://docs.djangoproject.com/en/4.1/ref/settings/#databases
+
+DATABASES = {
+ "default": {
+ "ENGINE": "django.db.backends.sqlite3",
+ "NAME": BASE_DIR / "db.sqlite3",
+ }
+}
+
+
+# Password validation
+# https://docs.djangoproject.com/en/4.1/ref/settings/#auth-password-validators
+
+AUTH_PASSWORD_VALIDATORS = [
+ {
+ "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
+ },
+ {
+ "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
+ },
+ {
+ "NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
+ },
+ {
+ "NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
+ },
+]
+
+
+# Internationalization
+# https://docs.djangoproject.com/en/4.1/topics/i18n/
+
+LANGUAGE_CODE = "en-us"
+
+TIME_ZONE = "UTC"
+
+USE_I18N = True
+
+USE_TZ = True
+
+
+# Static files (CSS, JavaScript, Images)
+# https://docs.djangoproject.com/en/4.1/howto/static-files/
+
+STATIC_URL = "static/"
+
+STATIC_ROOT = BASE_DIR / "static"
+
+# Default primary key field type
+# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field
+
+DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
+
+LOGGING = {
+ 'version': 1,
+ 'disable_existing_loggers': False,
+ 'handlers': {
+ 'console': {
+ 'class': 'logging.StreamHandler',
+ 'stream': sys.stdout,
+ },
+ },
+ 'root': {
+ 'handlers': ['console'],
+ 'level': 'INFO',
+ },
+ 'loggers': {
+ 'django': {
+ 'handlers': ['console'],
+ 'level': 'INFO',
+ 'propagate': True,
+ },
+ },
+}
+
+LOCALE_PATHS = [
+ os.path.join(BASE_DIR, 'locale'),
+]
diff --git a/project/urls.py b/project/urls.py
new file mode 100644
index 0000000..04452d5
--- /dev/null
+++ b/project/urls.py
@@ -0,0 +1,24 @@
+"""project URL Configuration
+
+The `urlpatterns` list routes URLs to views. For more information please see:
+ https://docs.djangoproject.com/en/4.1/topics/http/urls/
+Examples:
+Function views
+ 1. Add an import: from my_app import views
+ 2. Add a URL to urlpatterns: path('', views.home, name='home')
+Class-based views
+ 1. Add an import: from other_app.views import Home
+ 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
+Including another URLconf
+ 1. Import the include() function: from django.urls import include, path
+ 2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
+"""
+from django.contrib import admin
+from django.urls import path
+
+from dev import views
+
+urlpatterns = [
+ path("admin/", admin.site.urls),
+ path("", views.index, name="index"),
+]
diff --git a/project/wsgi.py b/project/wsgi.py
new file mode 100644
index 0000000..b5da491
--- /dev/null
+++ b/project/wsgi.py
@@ -0,0 +1,16 @@
+"""
+WSGI config for project project.
+
+It exposes the WSGI callable as a module-level variable named ``application``.
+
+For more information on this file, see
+https://docs.djangoproject.com/en/4.1/howto/deployment/wsgi/
+"""
+
+import os
+
+from django.core.wsgi import get_wsgi_application
+
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")
+
+application = get_wsgi_application()
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..8e9df22
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,5 @@
+[tool.flake8]
+max-line-length = 120
+
+[tool.isort]
+line_length = 120
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 0000000..9b15246
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1,3 @@
+asgiref==3.7.2
+Django==5.0.1
+sqlparse==0.4.4
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..9f75842
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,56 @@
+"""
+Setup configuration for the customersatisfactionmetrics package.
+
+This script is used to handle the packaging and distribution of the
+'customersatisfactionmetrics' package, including metadata, dependencies,
+and other necessary package information.
+"""
+
+from setuptools import setup
+
+# Using 'with' statement for safe file handling
+with open('README.md', 'r', encoding='utf-8') as f:
+ long_description = f.read()
+
+setup(
+ name='django-country-kit',
+ version="0.0.1",
+ author='Pescheck IT',
+ author_email='devops@pescheck.io',
+ description='Countries for django',
+ long_description=long_description,
+ long_description_content_type='text/markdown',
+ url='http://github.com/pescheckit/django-country-kit',
+ packages=["django_country_kit"],
+ include_package_data=True,
+ install_requires=[
+ 'Django>=3.0',
+ ],
+ classifiers=[
+ "Development Status :: 4 - Beta",
+ "Natural Language :: English",
+ "Topic :: Utilities",
+ "Environment :: Web Environment",
+ "Intended Audience :: Developers",
+ "License :: OSI Approved :: MIT License",
+ "Operating System :: OS Independent",
+ "Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 3.7",
+ "Programming Language :: Python :: 3.8",
+ "Programming Language :: Python :: 3.9",
+ "Programming Language :: Python :: 3.10",
+ "Programming Language :: Python :: 3.11",
+ "Programming Language :: Python :: 3.12",
+ "Framework :: Django",
+ "Framework :: Django :: 3.2",
+ "Framework :: Django :: 4.0",
+ "Framework :: Django :: 4.1",
+ "Framework :: Django :: 4.2",
+ "Framework :: Django :: 5.0",
+ ],
+ keywords=[
+ 'django',
+ 'country',
+ ],
+ license='MIT',
+)