Core
Apps
Circleci Settings
Django settings for our CircleCI workflow.
All configurations are imported from settings.
For more information on this file, see Django settings.
For the full list of settings and their values, see Settings.
- ycms.core.circleci_settings.SECRET_KEY = 'dummy'
Set a dummy secret key for CircleCI build even if it’s not in debug mode
Docker Settings
Django settings for different database configuration.
The docker container started in https://github.com/charludo/ycms/blob/develop/tools/run.sh exposes the alternative port 5434.
All other settings are imported from settings.
For more information on this file, see Django settings. For the full list of settings and their values, see Settings.
- ycms.core.docker_settings.DATABASES = {'default': {'ENGINE': 'django.db.backends.postgresql', 'HOST': 'localhost', 'NAME': 'ycms', 'PASSWORD': 'password', 'PORT': '5434', 'USER': 'ycms'}}
A dictionary containing the settings for all databases to be used with this Django installation (see
DATABASES){ 'default': { 'ENGINE': 'django.db.backends.postgresql', 'HOST': 'localhost', 'NAME': 'ycms', 'PASSWORD': 'password', 'PORT': '5434', 'USER': 'ycms', }, }
Logging Formatter
- class ycms.core.logging_formatter.ColorFormatter(fmt=None, datefmt=None, style='%', validate=True)
Bases:
FormatterLogging Formatter to add colors
- COLORS = {10: 36, 20: 34, 30: 33, 40: 31, 50: 31}
- format(record)
Format the specified record as colored text (see
logging.Formatter.format()).
- class ycms.core.logging_formatter.RequestFormatter(fmt=None, datefmt=None, style='%', validate=True)
Bases:
FormatterLogging Formatter to log the GET parameters of a failed HTTP request
- format(record)
Format the specified record including the request if possible (see
logging.Formatter.format()).
Settings
Django settings for ycms project.
Generated by ‘django-admin startproject’ using Django 4.1.2.
For more information on this file, see https://docs.djangoproject.com/en/4.1/topics/settings/
For the full list of settings and their values, see https://docs.djangoproject.com/en/4.1/ref/settings/
- ycms.core.settings.ADMINS = [('YCMS Helpdesk', 'tech@ycms.de')]
A list of all the people who get code error notifications. When
DEBUGisFalse, Django emails these people the details of exceptions raised in the request/response cycle.[('YCMS Helpdesk', 'tech@ycms.de')]
- ycms.core.settings.ALLOWED_HOSTS = ['.localhost', '127.0.0.1', '[::1]', 'localhost']
This is a security measure to prevent HTTP Host header attacks, which are possible even under many seemingly-safe
['.localhost', '127.0.0.1', '[::1]', 'localhost']
- ycms.core.settings.AVAILABLE_LANGUAGES = {'de': 'German', 'en': 'English'}
A list of all available languages with locale files for translated strings
{'de': 'German', 'en': 'English'}
- ycms.core.settings.DATABASES = {'default': {'ATOMIC_REQUESTS': False, 'AUTOCOMMIT': True, 'CONN_HEALTH_CHECKS': False, 'CONN_MAX_AGE': 0, 'ENGINE': 'django.db.backends.postgresql', 'HOST': 'localhost', 'NAME': 'ycms', 'OPTIONS': {}, 'PASSWORD': '', 'PORT': '5432', 'TEST': {'CHARSET': None, 'COLLATION': None, 'MIGRATE': True, 'MIRROR': None, 'NAME': None}, 'TIME_ZONE': None, 'USER': 'ycms'}}
A dictionary containing the settings for all databases to be used with this Django installation (see
DATABASES){ 'default': { 'ATOMIC_REQUESTS': False, 'AUTOCOMMIT': True, 'CONN_HEALTH_CHECKS': False, 'CONN_MAX_AGE': 0, 'ENGINE': 'django.db.backends.postgresql', 'HOST': 'localhost', 'NAME': 'ycms', 'OPTIONS': {}, 'PASSWORD': '', 'PORT': '5432', 'TEST': { 'CHARSET': None, 'COLLATION': None, 'MIGRATE': True, 'MIRROR': None, 'NAME': None, }, 'TIME_ZONE': None, 'USER': 'ycms', }, }
- ycms.core.settings.DEFAULT_FROM_EMAIL = 'noreply@example.com'
Default email address to use for various automated correspondence from the site manager(s) (see
DEFAULT_FROM_EMAIL)
- ycms.core.settings.DEFAULT_LANGUAGES = ['de', 'en']
The default UI languages
['de', 'en']
- ycms.core.settings.DEFAULT_OFFER_LANGUAGE = {'english_name': 'German', 'native_name': 'Deutsch'}
The default offer language
{'english_name': 'German', 'native_name': 'Deutsch'}
- ycms.core.settings.EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
The backend to use for sending emails (see
EMAIL_BACKENDand Sending email)
- ycms.core.settings.EMAIL_HOST = 'localhost'
The host to use for sending email (see
EMAIL_HOST)
- ycms.core.settings.EMAIL_HOST_PASSWORD = None
Password to use for the SMTP server defined in
EMAIL_HOST(seeEMAIL_HOST_PASSWORD). If empty, Django won’t attempt authentication.
- ycms.core.settings.EMAIL_HOST_USER = 'noreply@example.com'
Username to use for the SMTP server defined in
EMAIL_HOST(seeEMAIL_HOST_USER). If empty, Django won’t attempt authentication.
- ycms.core.settings.EMAIL_PORT = 587
Port to use for the SMTP server defined in
EMAIL_HOST(seeEMAIL_PORT)
- ycms.core.settings.EMAIL_USE_SSL = False
Whether to use an implicit TLS (secure) connection when talking to the SMTP server. In most email documentation this type of TLS connection is referred to as SSL. It is generally used on port 465. (see
EMAIL_USE_SSL)
- ycms.core.settings.EMAIL_USE_TLS = True
Whether to use a TLS (secure) connection when talking to the SMTP server. This will use Opportunistic TLS (STARTTLS command after starting a plain text connection). (see
EMAIL_USE_TLS)
- ycms.core.settings.LANGUAGES = [('de', 'German'), ('en', 'English')]
The list of languages which are available in the UI (see
LANGUAGESand Internationalization and localization)[('de', 'German'), ('en', 'English')]
- ycms.core.settings.LOCALE_PATHS = ['/home/docs/checkouts/readthedocs.org/user_builds/ycms/envs/latest/lib/python3.9/site-packages/ycms/locale']
A list of directories where Django looks for translation files (see
LOCALE_PATHSand Internationalization and localization)[ '/home/docs/checkouts/readthedocs.org/user_builds/ycms/envs/latest/lib/python3.9/site-packages/ycms/locale', ]
- ycms.core.settings.LOGFILE = '/home/docs/checkouts/readthedocs.org/user_builds/ycms/envs/latest/lib/python3.9/site-packages/ycms/ycms.log'
The file path of the logfile. Needs to be writable by the application.
- ycms.core.settings.LOGGING = {'disable_existing_loggers': False, 'filters': {'require_debug_false': {'()': 'django.utils.log.RequireDebugFalse'}, 'require_debug_true': {'()': 'django.utils.log.RequireDebugTrue'}}, 'formatters': {'console-colored': {'()': <class 'ycms.core.logging_formatter.ColorFormatter'>, 'datefmt': '%b %d %H:%M:%S', 'format': '{asctime} {levelname} {name} - {message}', 'style': '{'}, 'logfile': {'()': <class 'ycms.core.logging_formatter.RequestFormatter'>, 'datefmt': '%b %d %H:%M:%S', 'format': '{asctime} {levelname:7} {name} - {message}', 'style': '{'}, 'management-command': {'()': <class 'ycms.core.logging_formatter.ColorFormatter'>, 'format': '{message}', 'style': '{'}}, 'handlers': {'console-colored': {'class': 'logging.StreamHandler', 'filters': ['require_debug_true'], 'formatter': 'console-colored'}, 'logfile': {'class': 'logging.FileHandler', 'filename': '/home/docs/checkouts/readthedocs.org/user_builds/ycms/envs/latest/lib/python3.9/site-packages/ycms/ycms.log', 'formatter': 'logfile'}, 'management-command': {'class': 'logging.StreamHandler', 'filters': ['require_debug_true'], 'formatter': 'management-command'}}, 'loggers': {'ycms': {'handlers': ['console-colored', 'logfile'], 'level': 'INFO'}, 'ycms.core.management.commands': {'handlers': ['management-command', 'logfile'], 'level': 'INFO', 'propagate': False}}, 'version': 1}
Logging configuration dictionary (see
LOGGING){ 'disable_existing_loggers': False, 'filters': { 'require_debug_false': {'()': 'django.utils.log.RequireDebugFalse'}, 'require_debug_true': {'()': 'django.utils.log.RequireDebugTrue'}, }, 'formatters': { 'console-colored': { '()': <class 'ycms.core.logging_formatter.ColorFormatter'>, 'datefmt': '%b %d %H:%M:%S', 'format': '{asctime} {levelname} {name} - {message}', 'style': '{', }, 'logfile': { '()': <class 'ycms.core.logging_formatter.RequestFormatter'>, 'datefmt': '%b %d %H:%M:%S', 'format': '{asctime} {levelname:7} {name} - {message}', 'style': '{', }, 'management-command': { '()': <class 'ycms.core.logging_formatter.ColorFormatter'>, 'format': '{message}', 'style': '{', }, }, 'handlers': { 'console-colored': { 'class': 'logging.StreamHandler', 'filters': ['require_debug_true'], 'formatter': 'console-colored', }, 'logfile': { 'class': 'logging.FileHandler', 'filename': '/home/docs/checkouts/readthedocs.org/user_builds/ycms/envs/latest/lib/python3.9/site-packages/ycms/ycms.log', 'formatter': 'logfile', }, 'management-command': { 'class': 'logging.StreamHandler', 'filters': ['require_debug_true'], 'formatter': 'management-command', }, }, 'loggers': { 'ycms': {'handlers': ['console-colored', 'logfile'], 'level': 'INFO'}, 'ycms.core.management.commands': { 'handlers': ['management-command', 'logfile'], 'level': 'INFO', 'propagate': False, }, }, 'version': 1, }
- ycms.core.settings.LOG_LEVEL = 'INFO'
The log level for ycms django apps
- ycms.core.settings.MEDIA_MAX_UPLOAD_SIZE = 3145728
The maximum size of media files in bytes
- ycms.core.settings.MEDIA_ROOT = '/home/docs/checkouts/readthedocs.org/user_builds/ycms/envs/latest/lib/python3.9/site-packages/ycms/media'
Absolute filesystem path to the directory that will hold user-uploaded files (see
MEDIA_ROOT)
- ycms.core.settings.MEDIA_URL = '/media/'
URL that handles the media served from
MEDIA_ROOT(seeMEDIA_URL)
- ycms.core.settings.PRA_BASE = '/home/docs/checkouts/readthedocs.org/user_builds/ycms/envs/latest/lib/python3.9/patient-to-room_assignment'
Base path of the PRA solver. Assumes it is located in a sibling directory to this project.
- ycms.core.settings.PRA_INPUT_PATH = '/home/docs/checkouts/readthedocs.org/user_builds/ycms/envs/latest/lib/python3.9/patient-to-room_assignment/instances/generated.json'
Where to put the input for the PRA solver. Assumes it is located in a sibling directory to this project.
- ycms.core.settings.PRA_OUTPUT_PATH = '/home/docs/checkouts/readthedocs.org/user_builds/ycms/envs/latest/lib/python3.9/patient-to-room_assignment/Results/instances/generated_out.json'
Where the PRA solver puts its output. Assumes it is located in a sibling directory to this project.
- ycms.core.settings.SERVER_EMAIL = 'noreply@example.com'
The email address that error messages come from, such as those sent to
ADMINS. (seeSERVER_EMAIL)
- ycms.core.settings.STATICFILES_DIRS = ['/home/docs/checkouts/readthedocs.org/user_builds/ycms/envs/latest/lib/python3.9/site-packages/ycms/static', '/home/docs/checkouts/readthedocs.org/user_builds/ycms/envs/latest/lib/python3.9/site-packages/ycms/static/dist']
This setting defines the additional locations the
django.contrib.staticfilesapp will traverse to collect static files for deployment or to serve them during development (seeSTATICFILES_DIRSand Managing static files).[ '/home/docs/checkouts/readthedocs.org/user_builds/ycms/envs/latest/lib/python3.9/site-packages/ycms/static', '/home/docs/checkouts/readthedocs.org/user_builds/ycms/envs/latest/lib/python3.9/site-packages/ycms/static/dist', ]
- ycms.core.settings.STATICFILES_FINDERS = ('django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder')
The list of finder backends that know how to find static files in various locations (see
STATICFILES_FINDERS)( 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', )
- ycms.core.settings.STATIC_ROOT = None
The absolute path to the output directory where
django.contrib.staticfileswill put static files for deployment (seeSTATIC_ROOTand Managing static files) In debug mode, this is not required sincedjango.contrib.staticfilescan directly serve these files.
- ycms.core.settings.STATIC_URL = 'static/'
URL to use in development when referring to static files located in
STATICFILES_DIRS(seeSTATIC_URLand Managing static files)
- ycms.core.settings.WEBPACK_LOADER = {'DEFAULT': {'BUNDLE_DIR_NAME': '', 'STATS_FILE': '/home/docs/checkouts/readthedocs.org/user_builds/ycms/envs/latest/lib/python3.9/site-packages/ycms/webpack-stats.json'}}
Overwrite default bundle directory
{ 'DEFAULT': { 'BUNDLE_DIR_NAME': '', 'STATS_FILE': '/home/docs/checkouts/readthedocs.org/user_builds/ycms/envs/latest/lib/python3.9/site-packages/ycms/webpack-stats.json', }, }
Urls
ycms URL Configuration
- The urlpatterns list routes URLs to views. For more information please see:
Examples:
- Function views
Add an import: from my_app import views
Add a URL to urlpatterns: path(‘’, views.home, name=’home’)
- Class-based views
Add an import: from other_app.views import Home
Add a URL to urlpatterns: path(‘’, Home.as_view(), name=’home’)
- Including another URLconf
Import the include() function: from django.urls import include, path
Add a URL to urlpatterns: path(‘blog/’, include(‘blog.urls’))
Wsgi
WSGI config for ycms project.
It exposes the WSGI callable as a module-level variable named application.
For more information on this file, see https://docs.djangoproject.com/en/4.1/howto/deployment/wsgi/