forked from umap-project/umap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlocal_settings_example.py
More file actions
394 lines (366 loc) · 15.7 KB
/
local_settings_example.py
File metadata and controls
394 lines (366 loc) · 15.7 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
# -*- coding:utf-8 -*-
"""
Example settings for local development
Use this file as a base for your local development settings and copy
it to umap/settings/local.py. It should not be checked into
your code repository.
"""
from umap.settings.base import * # pylint: disable=W0614,W0401
SECRET_KEY = "!!change me!!"
INTERNAL_IPS = ("127.0.0.1",)
ALLOWED_HOSTS = [
"*",
]
# Simple password protection (temporary)
# Set to None to disable password protection
SIMPLE_PASSWORD_PROTECTION = "odv"
DEBUG = True
ADMINS = (("You", "your@email"),)
MANAGERS = ADMINS
DATABASES = {
"default": {
"ENGINE": "django.contrib.gis.db.backends.postgis",
"NAME": "umap",
"USER": "umap",
}
}
LANGUAGE_CODE = "en"
# Set to False if login into django account should not be possible. You can
# administer accounts in the admin interface.
ENABLE_ACCOUNT_LOGIN = True
"""LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"handlers": {
"console": {
"level": "DEBUG",
"class": "logging.StreamHandler",
},
},
"loggers": {
"django": {
"handlers": ["console"],
"level": "DEBUG",
},
},
}
"""
AUTHENTICATION_BACKENDS = (
"social_core.backends.github.GithubOAuth2",
# "social_core.backends.bitbucket.BitbucketOAuth",
# "social_core.backends.twitter.TwitterOAuth",
"social_core.backends.openstreetmap_oauth2.OpenStreetMapOAuth2",
"django.contrib.auth.backends.ModelBackend",
)
SOCIAL_AUTH_GITHUB_KEY = "GITHUB_KEY"
SOCIAL_AUTH_GITHUB_SECRET = "GITHUB_SECRET"
SOCIAL_AUTH_BITBUCKET_KEY = "BITBUCKET_KEY"
SOCIAL_AUTH_BITBUCKET_SECRET = "BITBUCKET_SECRET"
# We need email to associate with other Oauth providers
SOCIAL_AUTH_GITHUB_SCOPE = [
"user:email",
]
SOCIAL_AUTH_TWITTER_KEY = "TWITTER_KEY"
SOCIAL_AUTH_TWITTER_SECRET = "TWITTER_SECRET"
SOCIAL_AUTH_OPENSTREETMAP_OAUTH2_KEY = "OSM_KEY"
SOCIAL_AUTH_OPENSTREETMAP_OAUTH2_SECRET = "OSM_SECRET"
MIDDLEWARE += ("social_django.middleware.SocialAuthExceptionMiddleware",)
SOCIAL_AUTH_REDIRECT_IS_HTTPS = False
SOCIAL_AUTH_RAISE_EXCEPTIONS = False
SOCIAL_AUTH_BACKEND_ERROR_URL = "/"
# If you want to add a playgroud map, add its primary key
# UMAP_DEMO_PK = 204
# If you want to add a showcase map on the home page, add its primary key
# UMAP_SHOWCASE_PK = 1156
# Add a baner to warn people this instance is not production ready.
UMAP_DEMO_SITE = True
# Whether to allow non authenticated people to create maps.
UMAP_ALLOW_ANONYMOUS = True
# This setting will exclude empty maps (in fact, it will exclude all maps where
# the default center has not been updated)
UMAP_EXCLUDE_DEFAULT_MAPS = False
# How many maps should be showcased on the main page resp. on the user page
UMAP_MAPS_PER_PAGE = 5
# How many maps should be looked for when performing a (sub)search
UMAP_MAPS_PER_SEARCH = 15
# How many maps should be showcased on the user page, if owner
UMAP_MAPS_PER_PAGE_OWNER = 10
SITE_URL = "http://localhost:8000"
SHORT_SITE_URL = "http://s.hort"
# CACHES = {
# 'default': {
# 'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
# 'LOCATION': '/var/tmp/django_cache',
# }
# }
# POSTGIS_VERSION = (2, 1, 0)
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
# Put the site in readonly mode (useful for migration or any maintenance)
UMAP_READONLY = False
# For static deployment
STATIC_ROOT = "/srv/umap/var/static"
# For users' statics (geojson mainly)
MEDIA_ROOT = "/srv/umap/var/data"
# Default map location for new maps
LEAFLET_LONGITUDE = 2.2137
LEAFLET_LATITUDE = 47.7640
LEAFLET_ZOOM = 7
UMAP_FOCUS_COUNTRY = "FR"
# Number of old version to keep per datalayer.
UMAP_KEEP_VERSIONS = 10
# UMAP_DATA_API = "https://api.umap.datactivist.coop/api/v1/"
UMAP_DATA_API = "http://localhost:8001/api/v1/"
UMAP_IMPORTERS = {
"overpass": {"url": "https://overpass-api.de/api/interpreter"},
"communesfr": {"name": "Communes françaises"},
# ---------------------------
# SOLUTIONS VERTES
# ---------------------------
"datasets": {
"name": "Données vertes",
"choices": [
# Espaces verts — split per tag
{
"label": "Espaces verts — grass (OSM)",
"expression": "nwr[landuse=grass];out geom;",
"format": "osm",
"source": "https://wiki.openstreetmap.org/wiki/Tag:landuse%3Dgrass",
},
{
"label": "Espaces verts — forest (OSM)",
"expression": "nwr[landuse=forest];out geom;",
"format": "osm",
"source": "https://wiki.openstreetmap.org/wiki/Tag:landuse%3Dforest",
},
{
"label": "Espaces verts — nature_reserve (OSM)",
"expression": "nwr[leisure=nature_reserve];out geom;",
"format": "osm",
"source": "https://wiki.openstreetmap.org/wiki/Tag:leisure%3Dnature_reserve",
},
{
"label": "Espaces verts — recreation_ground (OSM)",
"expression": "nwr[leisure=recreation_ground];out geom;",
"format": "osm",
"source": "https://wiki.openstreetmap.org/wiki/Tag:leisure%3Drecreation_ground",
},
# Itinéraires de tramways — split per route
{
"label": "Itinéraires de tramways — tram (OSM)",
"expression": "nwr[route=tram];out geom;",
"format": "osm",
"source": "https://wiki.openstreetmap.org/wiki/Tag:route%3Dtram",
},
{
"label": "Itinéraires de tramways — light_rail (OSM)",
"expression": "nwr[route=light_rail];out geom;",
"format": "osm",
"source": "https://wiki.openstreetmap.org/wiki/Tag:route%3Dlight_rail",
},
# Arbres — natural=tree
{
"label": "Arbres (OSM)",
"expression": "nwr[natural=tree];out geom;",
"format": "osm",
"source": "https://wiki.openstreetmap.org/wiki/FR:Tag:natural%3Dtree",
},
{
"label": "Arbres (namR)",
"data": "arbres",
"geographic_query": "commune",
"format": "umap-data",
"source": "https://www.data.gouv.fr/datasets/arbres-en-open-data-en-france-par-namr/",
"description": "Ce jeu de données concerne l’ensemble des arbres urbains référencés dans l’open data. Pour plus d'information, se reporter à a description du jeu de données dans le lien qui mène à la source.",
},
],
},
# ---------------------------
# SOLUTIONS BLEUES
# ---------------------------
"datasets-2": {
"name": "Données bleues",
"choices": [
# Fontaines décoratives
{
"label": "Fontaines (OSM)",
"expression": "nwr[amenity=fountain];out geom;",
"format": "osm",
"source": "https://wiki.openstreetmap.org/wiki/Tag:amenity%3Dfountain",
"description": "Une fontaine ayant une importance culturelle, décorative ou historique ou qui sert à des fins récréatives.",
},
# Fontaines à eau potable
{
"label": "Fontaines à eau potable (OSM)",
"expression": "nwr[amenity=drinking_water];out geom;",
"format": "osm",
"source": "https://wiki.openstreetmap.org/wiki/FR:Tag:amenity%3Ddrinking_water",
"description": "Indique l'emplacement d'un robinet ou autre accès à de l'eau potable, ce qui inclut puits, robinets et sources.",
},
# Douches publiques
{
"label": "Douches publiques (OSM)",
"expression": "nwr[amenity=shower];out geom;",
"format": "osm",
"source": "https://wiki.openstreetmap.org/wiki/FR:Tag:amenity%3Dshower",
"description": "Douches publiques, où les gens peuvent se baigner sous des jets d'eau. Elles peuvent être gérées par les pouvoirs publics en tant qu'équipement local ou faire partie d'une offre commerciale et donc être payantes. Les douches de plage sont également signalées de cette manière.",
},
# Stockage d'eau
{
"label": "Stockage d'eau (OSM)",
"expression": "nwr[man_made=storage_tank][content=water];out geom;",
"format": "osm",
"source": "https://wiki.openstreetmap.org/wiki/Tag:man_made%3Dwater_tank",
},
# Points d'eau pour animaux
{
"label": "Points d'eau pour animaux (OSM)",
"expression": "nwr[amenity=watering_place];out geom;",
"format": "osm",
"source": "https://wiki.openstreetmap.org/wiki/FR:Tag:amenity%3Dwatering_place",
"description": "Cet attribut indique les endroits où les animaux peuvent boire de l'eau,",
},
# Espaces extérieurs rafraîchis : parcs, jardins, squares (split per tag)
{
"label": "Parcs (OSM)",
"expression": "nwr[leisure=park];out geom;",
"format": "osm",
"source": "https://wiki.openstreetmap.org/wiki/FR:Tag:leisure%3Dpark",
},
{
"label": "Jardins (OSM)",
"expression": "nwr[leisure=garden];out geom;",
"format": "osm",
"source": "https://wiki.openstreetmap.org/wiki/Tag:leisure%3Dgarden",
},
{
"label": "Squares (OSM)",
"expression": "nwr[place=square];out geom;",
"format": "osm",
"source": "https://wiki.openstreetmap.org/wiki/FR:Tag:place%3Dsquare",
},
{
"label": "BD Topage",
"data": "topage",
"geographic_query": "commune",
"format": "umap-data",
"source": "https://www.data.gouv.fr/fr/datasets/bd-topage-r/",
"description": "Le référentiel hydrographique vise à décrire les entités hydrographiques présentes sur le territoire français afin de constituer un référentiel national permettant de localiser des données relatives à l’eau.",
},
],
},
# ---------------------------
# SOLUTIONS GRISES
# ---------------------------
"datasets-3": {
"name": "Données grises",
"choices": [
# Musées
{
"label": "Musées (OSM)",
"expression": "nwr[tourism=museum];out geom;",
"format": "osm",
"source": "https://wiki.openstreetmap.org/wiki/Tag:tourism=museum",
"description": "Un musée. Institution qui présente des expositions sur des thèmes culturels, historiques, scientifiques. Peut être fortement impliqué dans l'acquisition, la conservation ou la recherche dans ces domaines. En général ouvert au public en tant qu'attraction touristique.",
},
# Centres commerciaux (shopping malls)
{
"label": "Centres commerciaux (OSM)",
"expression": "nwr[shop=mall];out geom;",
"format": "osm",
"source": "https://wiki.openstreetmap.org/wiki/Tag:shop=mall",
},
# Bâtiments publics / commerciaux (split per tag)
{
"label": "Bâtiments — commercial (OSM)",
"expression": "nwr[building=commercial];out geom;",
"format": "osm",
"source": "https://wiki.openstreetmap.org/wiki/Tag:building=commercial",
},
{
"label": "Bâtiments — retail (OSM)",
"expression": "nwr[building=retail];out geom;",
"format": "osm",
"source": "https://wiki.openstreetmap.org/wiki/Tag:building=retail",
},
{
"label": "Bâtiments — public_building (OSM)",
"expression": "nwr[amenity=public_building];out geom;",
"format": "osm",
"source": "https://wiki.openstreetmap.org/wiki/Tag:amenity=public_building",
},
{
"label": "Bâtiments — public (OSM)",
"expression": "nwr[building=public];out geom;",
"format": "osm",
"source": "https://wiki.openstreetmap.org/wiki/Tag:building=public",
},
# Ombrières — split per tag
{
"label": "Ombrières — canopy (OSM)",
"expression": "nwr[man_made=canopy];out geom;",
"format": "osm",
"source": "https://wiki.openstreetmap.org/wiki/Tag:man_made=canopy",
},
{
"label": "Ombrières — shelter (OSM)",
"expression": "nwr[amenity=shelter];out geom;",
"format": "osm",
"source": "https://wiki.openstreetmap.org/wiki/Tag:amenity=shelter",
},
{
"label": "Ombrières — tree (OSM)",
"expression": "nwr[natural=tree];out geom;",
"format": "osm",
"source": "https://wiki.openstreetmap.org/wiki/Tag:natural%3Dtree",
},
{
"label": "Ombrières — wood (OSM)",
"expression": "nwr[natural=wood];out geom;",
"format": "osm",
"source": "https://wiki.openstreetmap.org/wiki/Tag:natural=wood",
},
{
"label": "Réseau de froid",
"data": "reseaux-froid",
"geographic_query": "commune",
"format": "umap-data",
"source": "https://france-chaleur-urbaine.beta.gouv.fr/carte",
},
{
"label": "BPE - Base Permanente des Equipements (Aires de jeux)",
"data": "bpe",
"geographic_query": "commune",
"format": "umap-data",
"source": "https://www.data.gouv.fr/fr/datasets/base-permanente-des-equipements-1/",
"description": "La BPE permet de mieux connaître les équipements de service à la population et le niveau de ces équipements sur un territoire. La base permanente des équipements (BPE) est une base de données qui vise à rassemble des données administratives relatives aux équipements de service à la population. Les données de la BPE concernent uniquement les aires de jeux afin de pouvoir répondre à l'enjeu de surchauffe des jeux et équipements pour les enfants (cf tavaux de Plus fraîche ma ville : https://plusfraichemaville.fr/fiche-solution/jeux-et-equipements-durables-ecoles).",
},
],
},
# ---------------------------
# Everything else unchanged
# ---------------------------
"datasets-4": {
"name": "Données d'exposition",
"choices": [
{
"label": "MAPuCE",
"data": "mapuce",
"geographic_query": "commune",
"format": "umap-data",
"source": "https://github.com/orbisgis/mapuce.orbisgis.org/tree/gh-pages/data/icu",
"description": "Données sur les ICU. Travaux réalisés il y a 6 ans",
}
],
},
"datasets-5": {
"name": "Données de contexte",
"choices": [
{
"label": "Population",
"data": "population",
"geographic_query": "commune",
"format": "umap-data",
}
],
},
}