Skip to main content
django-cities-tiny -- *Simple django-cities alternative*
=========================================================

This add-on provides models and commands to import country/zone/city data into your
database.
The data is pulled from `GeoNames
<http://www.geonames.org/>`_ 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
`django-cities
<https://github.com/coderholic/django-cities>`_.

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

Installation
------------

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::

./manage.py syncdb

Data update
-----------

Finnaly, populate your database with command::

./manage.py citiestinyrefresh

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

./manage.py 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 settings.py::

CITIES_TINY_COUNTRIES = ('FR', 'US', 'BE')

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 settings.py, simply configure a handler and formatter for
`cities_tiny` logger. For example::

LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'simple': {
'format': '%(levelname)s %(message)s'
},
},
'handlers': {
'console':{
'level':'DEBUG',
'class':'logging.StreamHandler',
'formatter': 'simple'
},
},
'loggers': {
'cities_tiny': {
'handlers':['console'],
'propagate': True,
'level':'DEBUG',
},
# also use this one to see SQL queries
'django': {
'handlers':['console'],
'propagate': True,
'level':'DEBUG',
},
}
}

Metadata

Release files for django-cities-tiny 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-cities-tiny 1.0
File Size Uploaded Provenance Actions
django-cities-tiny-1.0.tar.gz 11.5 kB Without provenance Details for django-cities-tiny-1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-cities-tiny 1.0
File Interpreter ABI Platform Actions
django_cities_tiny-1.0-py2.6.egg Legacy Egg format - - Details for django_cities_tiny-1.0-py2.6.egg

Total release size: 35.3 kB

Release files / django-cities-tiny-1.0.tar.gz

Download URL django-cities-tiny-1.0.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
2e7dcdda55739c68bfee9a7b8b83cdb73a69d6c67c19ebf8a443084fa3db77d3
BLAKE2b-256 checksum
How to use checksums
bedd0d9ce30ccd19b3c138b86f42570e1bddc5d81e7ed36a75ea57f38f17584f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / django_cities_tiny-1.0-py2.6.egg

Download URL django_cities_tiny-1.0-py2.6.egg
Size 23.8 kB
Tags Egg
SHA-256 checksum
How to use checksums
e88890dbdbe54162d1f6f1c9cb3ff62726e11fab6cb4b223ac10b10bfd263555
BLAKE2b-256 checksum
How to use checksums
fa09ba65eba216b88d25f5ff2869d2d4eaf5566995f4d29acecf71be67f2d711
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-cities-tiny 1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page