Skip to main content

Another simple alternative to django-cities

Project description

django-cities-tiny -- *Simple django-cities alternative*

This add-on provides models and commands to import country/zone/city data into your
The data is pulled from `GeoNames
<>`_ and contains:

- country names
- administrative division zones
- city names

Spatial query support is not required by this application.

This application is very simple and is useful if you want to make a simple
address book for example. If you intend to build a fully featured spatial
database, you should use

This is a fork of django-cities-light by James Pic. The main difference of
django-cities-tiny is:

- support for localized names (from alternateNames.txt)
- support for administrative division zones (from admin1CodesASCII.txt,
admin2Codes.txt, or from XX.txt)
- required Django 1.0+, Python 2.3+ and no other dependences


Install django-cities-tiny::

easy_install django-cities-tiny

Add `cities_tiny` to your `INSTALLED_APPS`.

Now, run syncdb, it will create all required tables for models::

./ syncdb

Data update

Finnaly, populate your database with command::

./ citiestinyrefresh

This command is well documented, consult the help with::

./ help citiestinyrefresh

Limiting data to import

If you want to import only cities from France, USA and Belgium you could do as
such in your


Configure logging

To get output from citiestinyrefresh command simply pass the -v2 or or
--verbosity=2 option. Also if you use Django 1.3+, you may configure logging
system in your, simply configure a handler and formatter for
`cities_tiny` logger. For example::

'version': 1,
'disable_existing_loggers': False,
'formatters': {
'simple': {
'format': '%(levelname)s %(message)s'
'handlers': {
'formatter': 'simple'
'loggers': {
'cities_tiny': {
'propagate': True,
# also use this one to see SQL queries
'django': {
'propagate': True,

Project details

Release history Release notifications | RSS feed

This version


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-cities-tiny-1.0.tar.gz (11.5 kB view hashes)

Uploaded source

Built Distribution

django_cities_tiny-1.0-py2.6.egg (23.8 kB view hashes)

Uploaded 2 6

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page