A Django application consisting of all Tanzania locations from Regions to District. The full tutorial on how to integrate on django project found on How to create dependent dropdown list of Tanzania Region by Django Ajax
- Python 3.6+
- Pip or Pipenv
- Regions (region, capital, number of districts, area, population, postcode and zone)
- Districts (district, region, population)
- Wards
- Vilage/Streets
This package is available in Python Package Index and can be installed using pip
or pipenv
- Run
pip install django-mikoa
- Add
mikoa
toINSTALLED_APPS
- Run
python manage.py migrate
from mikoa.models import Region
regions = Region.objects.all()
print(regions)
from mikoa.models import District
districts = District.objects.all()
print(districts)
from mikoa.models import Region, District
regions = Region.objects.all()
for region in regions:
for district in region.district_set.all():
print(district.region.name)
print(district.name)
If you found this repository useful, give it a star so as the whole galaxy of developer can get to know it.
If you encounter issue with the usage of the package, feel free raise an issue so as we can fix it as soon as possible(ASAP).
If you have something to add I welcome pull requests on improvement , you're helpful contribution will be merged as soon as possible
All the location I used to build this repository, I got from an public repository titled tanzania-locations-db, I'm not responsible for any kind of misinformation in it, So use it to your own risk