-
Notifications
You must be signed in to change notification settings - Fork 10
/
settings.py
68 lines (63 loc) · 1.79 KB
/
settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
MONGO_HOST = 'localhost'
MONGO_PORT = 27017
MONGO_USER = ''
MONGO_PASSWORD = ''
DB_NAME = 'WorldCities'
CITY_COLLECTION_NAME = 'cities'
COUNTRY_COLLECTION_NAME = 'countries'
# Only countries with languages below.
# Find the languages here:
# http://www.lingoes.net/en/translator/langcode.htm
# city.country_code and country.iso MUST be there in order to enable this feature.
# Below is an example for only save all English speaking countries.
ONLY_LANGUAGE = [
# 'en',
# 'en-AU', 'en-BZ', 'en-CA', 'en-CB',
# 'en-GB', 'en-IE', 'en-JM', 'en-NZ',
# 'en-PH', 'en-TT', 'en-US', 'en-ZA',
# 'en-ZW'
]
# Add the name of field that you don't want to save to the database
# For instance, You don't want to save the alternate_names to cities collection
# Just add it: CITY_FIELDS_BLACKLIST = [ 'alternate_names' ]
# The BLACKLIST is always a list.
CITY_FIELDS_BLACKLIST = [
'feature_class',
'feature_code',
'admin1_code',
'admin2_code',
'admin3_code',
'admin4_code',
'population',
'elevation',
'dem',
'latitude',
'longitude',
'cc2',
'modification_date'
]
COUNTRY_FIELDS_BLACKLIST = [
'iso3',
'iso_numeric',
'fips',
'area',
'population',
'continent',
'tld',
'equivalent_fips_code',
'neighbours'
]
# It will duplicate a little data to prevent joint queries
# So after you retrieve the city info, you don't need to query the according
# country info using `geo_name_id`, there will be a country property for you. Vice versa
# And you can customize the fields as well
# The `geo_name_id` will always be added in case you need to refer each other
ADD_CITY_TO_COUNTRY = True
CITY_FIELDS_TO_ADD = ['name']
ADD_COUNTRY_TO_CITY = True
COUNTRY_FIELDS_TO_ADD = [
'iso',
'country',
'currency_code',
'currency_symbol'
]