django-cities-tiny

Another simple alternative to django-cities
Download

django-cities-tiny Ranking & Summary

Advertisement

  • Rating:
  • License:
  • MIT/X Consortium Lic...
  • Price:
  • FREE
  • Publisher Name:
  • Konstantin Korikov
  • Publisher web site:
  • http://lostclus.linux.kiev.ua/chestnut-ftp-search/

django-cities-tiny Tags


django-cities-tiny Description

django-cities-tiny is a Django app that provides models and commands to import country/zone/city data into your database. The data is pulled from GeoNames and contains: - country names - administrative division zones - city namesSpatial 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.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 dependencesInstallationInstall django-cities-tiny: easy_install django-cities-tinyAdd `cities_tiny` to your `INSTALLED_APPS`.Now, run syncdb, it will create all required tables for models:: ./manage.py syncdbData updateFinnaly, populate your database with command:: ./manage.py citiestinyrefreshThis command is well documented, consult the help with:: ./manage.py help citiestinyrefreshLimiting data to importIf 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 loggingTo 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':, 'propagate': True, 'level':'DEBUG', }, # also use this one to see SQL queries 'django': { 'handlers':, 'propagate': True, 'level':'DEBUG', }, } }Product's homepage


django-cities-tiny Related Software