-
Notifications
You must be signed in to change notification settings - Fork 3
/
settings.py
103 lines (91 loc) · 3.12 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
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
import os
from django.core.management.utils import get_random_secret_key
SECRET_KEY = os.environ.get("SECRET_KEY", get_random_secret_key())
DEBUG = True
# we look for values in the environment and fallback to the
# Django defaults if there are none set
env_ah = os.environ.get("DJANGO_ALLOWED_HOSTS", "").split(",")
ALLOWED_HOSTS = list(filter(None, env_ah))
env_csrf = os.environ.get("DJANGO_CSRF_TRUSTED_ORIGINS", "").split(",")
CSRF_TRUSTED_ORIGINS = list(filter(None, env_csrf))
# Application definition
INSTALLED_APPS = [
# our main app, containing the ontology (in the `models.py`)
# and our customizations
"sample_project",
# `apis_override_select2js` is a workaround for APIS'
# handling of autocomplete forms. It should be listed
# at the beginning of the list, to make sure the
# files shipped with it are served in precedence.
"apis_override_select2js",
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
# ui stuff used by APIS
"crispy_forms",
"crispy_bootstrap4",
"django_filters",
"django_tables2",
"dal",
"dal_select2",
# REST API
"rest_framework",
# swagger ui generation
"drf_spectacular",
# The APIS apps
"apis_core.core",
"apis_core.generic",
"apis_core.apis_metainfo",
"apis_core.apis_relations",
"apis_core.apis_entities",
# apis_vocabularies is deprecated, but there are
# still migrations depending on it - it will be dropped
# at some point
"apis_core.apis_vocabularies",
# APIS collections provide a collection model similar to
# SKOS collections and allow tagging of content
"apis_core.collections",
# APIS history modules tracks changes of instances over
# time and lets you revert changes
"apis_core.history",
]
MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
]
# ROOT_URLCONF = "apis_core.urls"
ROOT_URLCONF = "sample_project.urls"
TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [],
"APP_DIRS": True,
"OPTIONS": {
"context_processors": [
"django.template.context_processors.debug",
"django.template.context_processors.request",
"django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages",
],
},
},
]
STATIC_URL = "/static/"
STATIC_ROOT = "/tmp/staticfiles"
PROJECT_DEFAULT_MD = {}
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": "/tmp/db.sqlite3",
},
}
CRISPY_TEMPLATE_PACK = "bootstrap4"
DJANGO_TABLES2_TEMPLATE = "django_tables2/bootstrap4.html"