Simple City DB for Django, includes Ajax select filtering.
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


This is a very small app to let you easily add Country/City selects with filtering. So you pick a country and it filters the list of cities. The data is from so you better make sure you satisfy their licensing conditions. :)

This was inspired by wanting to use django-cities ( ) for some simple form stuff and being put off by having to install GeoDjango.

I'm pretty responsive, so please flame, or preferrably contribute patches!

1. Download the files:

2. Add "simplecities" and "smart_selects" (pip install smart-selects) to your INSTALLED_APPS setting. smart-selects:

3. Add the required smart-selects urls:
	url(r'^chaining/', include('smart_selects.urls')),

3. Run "./ syncdb" (or "./ migrate simplecities" if you use South)

4. Run the command to load the data:
 	manage loadsimplecities /path/to/cities1000.txt /path/to/countryInfo.txt

5. Use the location form:
	from simplecitites.forms import LocationForm
	def location_details(request):
		location_form = LocationForm(request.POST or None)
		return render(request,'some_template.html',{
			"location_form": location_form

6. Render the form in the template:
	{{ location_form }}