konova/konova/settings.py

87 lines
2.6 KiB
Python
Raw Normal View History

2021-07-01 13:36:07 +02:00
"""
Django settings for konova project.
Generated by 'django-admin startproject' using Django 3.1.2.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from django.utils.translation import gettext_lazy as _
2021-07-01 13:36:07 +02:00
# Load other settings
from konova.sub_settings.django_settings import *
# ALLOWED FILE UPLOAD DEFINITIONS
# Default: Upload into upper folder of code
MEDIA_ROOT = BASE_DIR + "/.."
# DOCUMENT UPLOAD PATHS
# Extends MEDIA_ROOT (https://docs.djangoproject.com/en/3.2/ref/settings/#std:setting-MEDIA_ROOT)
## {} is a placeholder for the object's uuid --> each object will have it's own folder
BASE_DOC_PATH = "konova_uploaded_files/"
INTERVENTION_DOC_PATH = BASE_DOC_PATH + "interventions/{}/"
INTERVENTION_REVOCATION_DOC_PATH = BASE_DOC_PATH + "interventions/{}/revocation/"
COMPENSATION_DOC_PATH = BASE_DOC_PATH + "compensations/{}/"
ECO_ACCOUNT_DOC_PATH = BASE_DOC_PATH + "eco_account/{}/"
EMA_DOC_PATH = BASE_DOC_PATH + "ema/{}/"
2021-07-01 13:36:07 +02:00
# German DateTime string format
STRF_DATE_TIME = "%d.%m.%Y %H:%M:%S"
# Tables
RESULTS_PER_PAGE_PARAM = "rpp"
PAGE_PARAM = "page"
PAGE_SIZE_OPTIONS = [5, 10, 15, 20, 25, 50, 100]
2021-07-01 13:36:07 +02:00
PAGE_SIZE_OPTIONS_TUPLES = [
(5, 5),
(10, 10),
(15, 15),
(20, 20),
(25, 25),
(50, 50),
(100, 100),
]
PAGE_SIZE_DEFAULT = 5
PAGE_SIZE_MAX = 100
PAGE_DEFAULT = 1
# SSO settings
SSO_SERVER_BASE = "http://127.0.0.1:8000/"
SSO_SERVER = f"{SSO_SERVER_BASE}sso/"
2021-07-01 13:36:07 +02:00
SSO_PRIVATE_KEY = "QuziFeih7U8DZvQQ1riPv2MXz0ZABupHED9wjoqZAqeMQaqkqTfxJDRXgSIyASwJ"
SSO_PUBLIC_KEY = "AGGK7E8eT5X5u2GD38ygGG3GpAefmIldJiiWW7gldRPqCG1CzmUfGdvPSGDbEY2n"
# MAPS
DEFAULT_LAT = 50.00
DEFAULT_LON = 7.00
DEFAULT_ZOOM = 8.0
DEFAULT_SRID = 4326
DEFAULT_SRID_RLP = 25832
# GROUPS
DEFAULT_GROUP = "Default"
ZB_GROUP = "Registration office"
ETS_GROUP = "Conservation office"
# Needed to redirect to LANIS
## Values to be inserted are [zoom_level, x_coord, y_coord]
LANIS_LINK_TEMPLATE = "https://geodaten.naturschutz.rlp.de/kartendienste_naturschutz/index.php?lang=de&zl={}&x={}&y={}&bl=tk_rlp_tms_grau&bo=1&lo=0.8,0.8,0.8,0.6,0.8,0.8,0.8,0.8,0.8&layers=eiv_f,eiv_l,eiv_p,kom_f,kom_l,kom_p,oek_f,ema_f,mae&service=kartendienste_naturschutz"
## This look up table (LUT) defines different zoom levels on the size of the calculate area of a geometry.
LANIS_ZOOM_LUT = {
1000000000: 6,
100000000: 10,
10000000: 17,
1000000: 20,
100000: 25,
10000: 28,
1000: 30,
500: 31,
}
# Parcel WFS settings
PARCEL_WFS_BASE_URL = "https://www.geoportal.rlp.de/registry/wfs/519"
PARCEL_WFS_USER = "ksp"
PARCEL_WFS_PW = "CHANGE_ME"