Skip to content

MohmdFo/django-iranian-cities

 
 

Repository files navigation

Django Iranian Cities

The django-iranian-cities is a valuable package based on Django Web Framework for Iranian cities support. You can see full documentation here readthedocs.

SageTeam

License PyPI release Supported Python versions Supported Django versions Documentation Last Commit Languages

Project Detail

  • Language: Python > 3.6
  • Framework: Django > 3.2

Getting Started

First you have to install package using pip:

$ pip install django-iranian-cities

Then you should add iranian_cities to INSTALLED_APPS:

INSTALLED_APPS = [
    ...
    'iranian_cities',
    ...
]

Now you can migrate to apply model changes:

$ python manage.py migrate

For generating all data you can run this command:

$ python manage.py generate_city

NOTE: you should run this command once (if you want to run again flush db or delete all objects in iranian_cities app)

Usage

You can use field like this:

from django.db import models
from iranian_cities.fields import ProvinceField

class TestModel(models.Model):
    province = ProvinceField()

list of fields:

- ProvinceField
- CountyField
- DistrictField
- CityField
- RuralDistrictField
- VillageField


## Admin

You can also use admin mixin class:

```python
from django.contrib import admin
from iranian_cities.admin import IranianCitiesAdmin
from test_app.models import TestModel

@admin.register(TestModel)
class TestModelAdmin(IranianCitiesAdmin):
    pass

Admin

Git Rules

S.A.G.E. team Git Rules Policy is available here:

Team

Sepehr Akbarzadeh Mehran Rahmanzadeh
Sepehr Akbarazadeh Maintainer Mehran Rahmanzadeh Maintainer

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%