Quick Start
Install the package:
$ pip install django-iranian-cities
Add `iranian_cities` to `INSTALLED_APPS` in your Django settings:
INSTALLED_APPS = [ ## Other apps "iranian_cities", ]
Run migrations to apply model changes:
$ python manage.py migrate
Generate Data: To populate the database with Iranian cities data, use the provided management command. This command will:
Check if there is existing data in the tables.
Prompt you to confirm if you want to flush the tables if they already contain data.
Read CSV files and populate the Province, County, District, City, RuralDistrict, and Village tables with data.
$ python manage.py generate_city
If tables contain data, you will be prompted to either flush them or cancel the operation.