Skip to main content

django-countries-states-cities

1. Installation

The preferred installation method is directly from pypi:

# Install django-countries-states-cities
$ pip install -U django-countries-states-cities

This Django library is built using the Countries States Cities Database.

2. Quickstart

In settings.py:

INSTALLED_APPS = [
    'modeltranslation',
    'django.contrib.admin',
    ...,
    'import_export',
    'countries_states_cities'
]

LANGUAGES = [
    ("en", "English"),
    ("ko", "Korean"),
    ("ja", "Japanese"),
    ('zh-hans', 'Simplified Chinese'),  # 간체 중국어
    ('zh-hant', 'Traditional Chinese'),  # 번체 중국어
    ("es", "Spanish"),
    ("ru", "Russian"),
    ("ar", "Arabic"),
]
  1. In urls.py:
from django.urls import path, include

urlpatterns = [
    ...,
    path('csc/', include('countries_states_cities.urls')),
]

3. Database Setup

Run the following commands to set up the database:

# Create migration files for countries_states_cities models
$ python manage.py makemigrations countries_states_cities

# Apply migrations to create countries_states_cities models
$ python manage.py migrate

4. Loading Initial Data

To load initial data into the database, run the custom command:

$ python manage.py csc_loaddata_csv

This command will import data from predefined CSV files into the database.

5. Further Configuration

For further configuration and usage instructions, please refer to the official documentation.

The MIT License

Copyright (c) 2023 Runners Co.,Ltd.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Metadata

Release files for django-countries-states-cities 1.0.23

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-countries-states-cities 1.0.23
File Size Uploaded
django_countries_states_cities-1.0.23.tar.gz 8.7 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-countries-states-cities 1.0.23
File Interpreter ABI Platform
django_countries_states_cities-1.0.23-py3-none-any.whl Python 3 none any Details

Total release size: 17.5 MB

Release files / django_countries_states_cities-1.0.23.tar.gz

Download URL django_countries_states_cities-1.0.23.tar.gz
Size 8.7 MB
Tags Source
SHA-256 checksum
How to use checksums
3c610d8446c099244f31d40d5d6dade16b27fd52ac7be8ab0d944343c3dde189
BLAKE2b-256 checksum
How to use checksums
a97a236ecd2d6141353cb527f46c465864329bee6312dfc3a6ea912f28a0779e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.0

Release files / django_countries_states_cities-1.0.23-py3-none-any.whl

Download URL django_countries_states_cities-1.0.23-py3-none-any.whl
Size 8.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
e48c7d4ad3b8707e4907cde6007ef2c53c146a3048264802b8f6ada10dbb3422
BLAKE2b-256 checksum
How to use checksums
4ec3bef514163794ee178fedeba2f95540be5828f4cd72670d00a99993fbf7d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.0

Release history Release notifications | RSS feed

This release

1.0.23 This release

2 release files

1.0.19

1 release file

1.0.18

1 release file

1.0.17

1 release file

1.0.16

1 release file

1.0.15

1 release file

1.0.14

1 release file

1.0.13

1 release file

1.0.12

1 release file

1.0.10

1 release file

1.0.9

1 release file

1.0.8

1 release file

1.0.7

1 release file

1.0.4

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

0.2.11

1 release file

0.2.8

1 release file

0.2.7

1 release file

0.2.6

1 release file

0.2.5

1 release file

0.2.4

1 release file

0.2.3

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.1.9

1 release file

0.1.8

1 release file

0.1.7

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page