Simple django app

Settings

Settings for this application. The most important is TRANSLATION_LANGUAGES because it’s probably project specific.

cities_light.settings.TRANSLATION_LANGUAGES

List of language codes. It is used to generate the alternate_names property of cities_light models. You want to keep it as small as possible. By default, it includes the most popular languages according to wikipedia, which use a rather ascii-compatible alphabet. It also contains ‘abbr’ which stands for ‘abbreviation’, you might want to include this one as well.

See:

Example:

CITIES_LIGHT_TRANSLATION_LANGUAGES = ['es', 'en', 'fr', 'abbr']
cities_light.settings.INCLUDE_COUNTRIES

List of country codes to include. It’s None by default which lets all countries in the database. But if you only wanted French and Belgium countries/regions/cities, you could set it as such:

CITIES_LIGHT_INCLUDE_COUNTRIES = ['FR', 'BE']
cities_light.settings.INCLUDE_CITY_TYPES

List of city feature codes to include. They are described at http://www.geonames.org/export/codes.html, section “P city, village”.

CITIES_LIGHT_INCLUDE_CITY_TYPES = [
‘PPL’, ‘PPLA’, ‘PPLA2’, ‘PPLA3’, ‘PPLA4’, ‘PPLC’, ‘PPLF’, ‘PPLG’, ‘PPLL’, ‘PPLR’, ‘PPLS’, ‘STLMT’,

]

cities_light.settings.COUNTRY_SOURCES

A list of urls to download country info from. Default is countryInfo.txt from geonames download server. Overridable in settings.CITIES_LIGHT_COUNTRY_SOURCES.

cities_light.settings.REGION_SOURCES

A list of urls to download region info from. Default is admin1CodesASCII.txt from geonames download server. Overridable in settings.CITIES_LIGHT_REGION_SOURCES.

cities_light.settings.CITY_SOURCES

A list of urls to download city info from. Default is cities15000.zip from geonames download server. Overridable in settings.CITIES_LIGHT_CITY_SOURCES.

cities_light.settings.TRANSLATION_SOURCES

A list of urls to download alternate names info from. Default is alternateNames.zip from geonames download server. Overridable in settings.CITIES_LIGHT_TRANSLATION_SOURCES.

cities_light.settings.SOURCES

A list with all sources, auto-generated.

cities_light.settings.DATA_DIR

Absolute path to download and extract data into. Default is cities_light/data. Overridable in settings.CITIES_LIGHT_DATA_DIR

cities_light.settings.INDEX_SEARCH_NAMES

If your database engine for cities_light supports indexing TextFields (ie. it is not MySQL), then this should be set to True. You might have to override this setting with settings.CITIES_LIGHT_INDEX_SEARCH_NAMES if using several databases for your project.

cities_light.settings.CITIES_LIGHT_APP_NAME

Modify it only if you want to define your custom cities models, that are inherited from abstract models of this package. It must be equal to app name, where custom models are defined. For example, if they are in geo/models.py, then set settings.CITIES_LIGHT_APP_NAME = 'geo'. Note: you can’t define one custom model, you have to define all of cities_light models, even if you want to modify only one.

class cities_light.settings.ICountry[source]

Country field indexes in geonames.

class cities_light.settings.IRegion[source]

Region field indexes in geonames.

class cities_light.settings.ICity[source]

City field indexes in geonames. Description of fields: http://download.geonames.org/export/dump/readme.txt

class cities_light.settings.IAlternate[source]

Alternate names field indexes in geonames. Description of fields: http://download.geonames.org/export/dump/readme.txt

Models

See source for details.

Admin

See source for details.