Main configurations. Explanations of all options can be found in the Django docs.
Generally, the most important settings - but also as few as possible - should be fetched from environment variables. This is good practice (see 12 Factor App) and especially for security related stuff important. Although LyProX doesn't really have much security relevant stuff going on.
The settings are written such that errors are thrown when the required environment vars are not present. This is by design, to ensure the host environment is configured for the application. It is recommended that you write an .env file at the root of the project (DON'T TRACK IT WITH GIT!), from which the environment variables are loaded. The .env file should look like this:
# .env
DJANGO_ENV=debug
DJANGO_SECRET_KEY=...
The minimally required environment variables that need to be set are:
- DJANGO_ENV can be "debug", "maintenance", or "production".
- DJANGO_SECRET_KEY determines the value of the app's
SECRET_KEY
and must contain the secret key for Django's security stuff. - DJANGO_ALLOWED_HOSTS needs to contain the allowed host names separated by spaces.
It will be stored in the
ALLOWED_HOSTS
setting. - DJANGO_LOG_LEVEL for Django's
LOG_LEVEL
. This only has an effect in debug mode. - DJANGO_BASE_DIR is the directory in which Django is based. Using
BASE_DIR
, this is used to determine the location of the database and static files. - GITHUB_TOKEN is the token for the GitHub API. This determines the value of the
corresponding
GITHUB_TOKEN
setting. See this variable's docstring for more details. Note that if this is not set, it won't immediately throw an error, but the datasets will likely fail to be loaded initially.
Class |
|
Tumor stages. |
Function | set |
Return logging settings for specified log_level. |
Constant | ALLOWED |
From which hosts the application is allowed to be accessed. |
Constant | AUTH |
Undocumented |
Constant | AUTH |
Undocumented |
Constant | BASE |
Path to the base directory of the project. |
Constant | CRSF |
Undocumented |
Constant | CSRF |
Undocumented |
Constant | DATABASES |
Undocumented |
Constant | DBBACKUP |
Undocumented |
Constant | DBBACKUP |
Undocumented |
Constant | DEBUG |
True, when in debug mode, meaning DJANGO_ENV is set to "debug". |
Constant | DEFAULT |
Undocumented |
Constant | GITHUB |
Undocumented |
Constant | GITHUB |
Undocumented |
Constant | GITHUB |
Undocumented |
Constant | GITHUB |
Authentication token for GitHub API. |
Constant | INSTALLED |
Undocumented |
Constant | JOBLIB |
Undocumented |
Constant | LANGUAGE |
Undocumented |
Constant | LNLS |
Undocumented |
Constant | LOG |
Minimum level of emitted log messages. |
Constant | LOGGING |
Undocumented |
Constant | LOGIN |
List of regexes for urls that are exceptions from the LOGIN_REQUIRED_URLS . |
Constant | LOGIN |
Redirect to this URL after successful login. |
Constant | LOGIN |
URL to redirect to when login is required. |
Constant | MAINTENANCE |
If True, all requests to are redirected to a maintenance page. DJANGO_ENV must be set to "maintenance" for this to work. Also see lyprox.views.maintenance . |
Constant | MEDIA |
Undocumented |
Constant | MEDIA |
Undocumented |
Constant | MIDDLEWARE |
Undocumented |
Constant | PRODUCTION |
The environment mode. |
Constant | PUBLICATIONS |
Undocumented |
Constant | ROOT |
Undocumented |
Constant | SECRET |
Secret key for cryptography read from the environment variable DJANGO_SECRET_KEY. |
Constant | SECURE |
Undocumented |
Constant | SECURE |
Undocumented |
Constant | SECURE |
Undocumented |
Constant | SECURE |
Undocumented |
Constant | SESSION |
Undocumented |
Constant | STATIC |
Undocumented |
Constant | STATIC |
Undocumented |
Constant | STATICFILES |
Undocumented |
Constant | TEMPLATES |
Undocumented |
Constant | TIME |
Undocumented |
Constant | USE |
Undocumented |
Constant | USE |
Undocumented |
Constant | USE |
Undocumented |
Type Alias |
|
Undocumented |
Variable | LOGIN |
List of regexes for urls that require login. |
Variable | _login |
Undocumented |
Return logging settings for specified log_level.
This is used so that in a subdomain settings file the function can be called again to overwrite the logging settings easily.
From which hosts the application is allowed to be accessed.
This is space-separated list of hostnames from which access is allowed. Set to "localhost 127.0.0.1" for local use. For deployment this should be changed to the domain name you are using.
Value |
|
Undocumented
Value |
|
Path to the base directory of the project.
The base directory of the server is ypically the root of the repository. From this directory, the web app infers the location of a couple of directories and paths it needs e.g. for loading and storing static files and media stuff. If this isn't set, one might end up with a situation where Django tries to set up everything relative to the site-packages folder inside the .venv.
Value |
|
Undocumented
Value |
|
True, when in debug mode, meaning DJANGO_ENV is set to "debug".
Value |
|
Authentication token for GitHub API.
A personal secret for accessing GitHub's official API. This is used to access the lyDATA repo and fetch the datasets. Refer to the GitHub documentation on how to create such a token.
Value |
|
Undocumented
Value |
|
Minimum level of emitted log messages.
The log level only has an effect in "debug" mode. Is set to "WARNING" otherwise.
Value |
|
List of regexes for urls that are exceptions from the LOGIN_REQUIRED_URLS
.
Value |
|
If True, all requests to are redirected to a maintenance page. DJANGO_ENV must
be set to "maintenance" for this to work. Also see lyprox.views.maintenance
.
Value |
|
Undocumented
Value |
|
The environment mode.
Can be "debug", "production", or "maintenance". For running the interface locally, it should be set to "debug".
Value |
|
Secret key for cryptography read from the environment variable DJANGO_SECRET_KEY.
This is the app-wide secret for authentication and security functions. It can be generated using django's built-in functions. Enter a python REPL by typing python into the terminal and then execute these two commands:
>>> from django.core.management.utils import get_random_secret_key >>> print(get_random_secret_key())
This will output something like 6-y$g=ek4x!f3kq+=c+f%5@(f1efpdl!(sp&so(bgdli_&_8+n. Note that this is the most sensitive variable for the security of the web app!
Value |
|
Undocumented
Value |
|
List of regexes for urls that require login.
Note that this may simply be left empty, since the critical views are protected by default. But if you want to protect e.g. the entire website, you can add "(.*)$" to the list.