Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 43 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,49 @@ Consult the help with::

./manage.py help cities_light_fixtures


Common issues
--------------

Search names index size issue
------------------------------

If you get the following error::

django.db.utils.OperationalError: index row size 2848 exceeds btree version 4 maximum 2704 for index "cities_light_city_search_names_fb77fed2"
DETAIL: Index row references tuple (1314,1) in relation "cities_light_city".
HINT: Values larger than 1/3 of a buffer page cannot be indexed.
Consider a function index of an MD5 hash of the value, or use full text indexing.

You can fix it by adding the following to your settings.py, this will disable the indexing of the search_names field::

CITIES_LIGHT_INDEX_SEARCH_NAMES = False

Another option is limiting the languages for example to only English and abbreviation, this will fix the issue::

CITIES_LIGHT_TRANSLATION_LANGUAGES = [ 'en', 'abbr']

You want to import only the countries you need, for example France, Belgium and Netherlands, you can do it by adding the following to your settings.py::

CITIES_LIGHT_INCLUDE_COUNTRIES = ['FR', 'BE', 'NL']

You want to import only the cities you need, for example Paris, Brussels and Amsterdam, you can do it by adding the following to your settings.py::

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

You don't want to import the cities and regions and subregions, you can do it by adding the following to your settings.py::

CITIES_LIGHT_INCLUDE_CITY_TYPES = []
CITIES_LIGHT_INCLUDE_REGION_TYPES = []
CITIES_LIGHT_INCLUDE_SUBREGION_TYPES = []

Or you can set the sources to empty list:

CITIES_LIGHT_REGION_SOURCES = []
CITIES_LIGHT_SUBREGION_SOURCES = []
CITIES_LIGHT_CITY_SOURCES = []


Development
-----------

Expand Down Expand Up @@ -166,13 +209,6 @@ To run it even faster, you can switch to specific tox virtualenv::
CI=true test_project/manage.py test cities_light.tests.test_form.FormTestCase.testCountryFormNameAndContinentAlone


If you want to generate the translations, use the following steps::

source .tox/dev/bin/activate
cd src/cities_light
python manage.py makemessages -l fr
python manage.py compilemessages

If you want to build the docs, use the following steps::

source .tox/dev/bin/activate
Expand Down