forked from elpaso/qgis-feed
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathsettings_docker_production.py
More file actions
38 lines (30 loc) · 1.11 KB
/
settings_docker_production.py
File metadata and controls
38 lines (30 loc) · 1.11 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
# Settings local for docker compose production settings
import os
DEBUG = False
ALLOWED_HOSTS = ["*"]
DATABASES = {
"default": {
"ENGINE": "django.contrib.gis.db.backends.postgis",
"NAME": os.getenv("QGISFEED_DOCKER_DBNAME", "qgisfeed"),
"USER": os.getenv("QGISFEED_DOCKER_DBUSER", "docker"),
"PASSWORD": os.getenv("QGISFEED_DOCKER_DBPASSWORD", "docker"),
"HOST": os.getenv("QGISFEED_DOCKER_DBHOST", "postgis"),
"PORT": "5432",
}
}
MEDIA_ROOT = os.getenv("MEDIA_ROOT", "/shared-volume/media/")
MEDIA_URL = "/media/"
STATIC_ROOT = os.getenv("STATIC_ROOT", "/shared-volume/static/")
STATIC_URL = "/static/"
if not os.path.exists(MEDIA_ROOT):
os.mkdir(MEDIA_ROOT)
if not os.path.exists(STATIC_ROOT):
os.mkdir(STATIC_ROOT)
# settings for enabling https forwarding
USE_X_FORWARDED_PORT = True
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
QGIS_FEED_PROD_URL = os.environ.get("QGIS_FEED_PROD_URL", False)
CSRF_TRUSTED_ORIGINS = [
p + QGIS_FEED_PROD_URL for p in ["http://", "https://"] if QGIS_FEED_PROD_URL
]
CORS_ORIGIN_WHITELIST = CSRF_TRUSTED_ORIGINS