If there was something plug 🔌 and play which can be just imported and it'll fill the choices fields with Indian cities or states. How good it'll be.
To import just add this line
from indian_cities.dj_city import cities
Test it
print(cities[0])
Now if the output looks like this
('Andaman and Nicobar Islands', (('Port Blair', 'Port Blair'),))
Then awesome, it did work 👍
class myModel(models.Model):
city = models.CharField(choices=cities, null=False, max_length=20)
Any version of Python, Django
To install this
pip install indian-cities
LinkedIn: https://www.linkedin.com/in/chayandatta/
github: https://github.com/chayandatta
made with ❤️ and 🐍