Core

This is the project’s main app which contains all configuration files.

Context Processors

Context processors pass additional variables to templates (see Built-in template context processors).

lunes_cms.core.context_processors.feedback_processor(request)

This context processor injects the number of unread feedback entries into the template context.

Parameters:

request (HttpRequest) – The current http request

Returns:

The template context containing the number of unread feedback entries

Return type:

dict

Logging Formatter

class lunes_cms.core.logging_formatter.ColorFormatter(fmt=None, datefmt=None, style='%', validate=True)

Bases: Formatter

Logging Formatter to add colors

COLORS = {10: 36, 20: 34, 30: 33, 40: 31, 50: 31}

The bash color codes for the different logging levels

format(record)

Format the specified record as colored text (see logging.Formatter.format()).

Parameters:

record (LogRecord) – The log record

Returns:

The formatted logging message

Return type:

str

Settings

Django settings for lunes-cms project.

Generated by ‘django-admin startproject’ using Django 2.2.

For more information on this file, see https://docs.djangoproject.com/en/2.2/topics/settings/

For the full list of settings and their values, see https://docs.djangoproject.com/en/2.2/ref/settings/

lunes_cms.core.settings.ALLOWED_HOSTS = ['.localhost', '127.0.0.1', '[::1]']

This is a security measure to prevent HTTP Host header attacks, which are possible even under many seemingly-safe web server configurations (see ALLOWED_HOSTS and Host header validation)

['.localhost', '127.0.0.1', '[::1]']
lunes_cms.core.settings.AUTH_PASSWORD_VALIDATORS = [{'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator'}, {'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator'}, {'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator'}, {'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator'}]

The list of validators that are used to check the strength of user’s passwords. See Password validation for more details. By default, no validation is performed and all passwords are accepted.

[
    {
        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator'},
    {
        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
    },
]
lunes_cms.core.settings.BASE_DIR = '/home/docs/checkouts/readthedocs.org/user_builds/lunes-cms/envs/latest/lib/python3.9/site-packages/lunes_cms'

Build paths inside the project like this: os.path.join(BASE_DIR, ...)

lunes_cms.core.settings.DATABASES = {'default': {'ATOMIC_REQUESTS': False, 'AUTOCOMMIT': True, 'CONN_MAX_AGE': 0, 'ENGINE': 'django.db.backends.postgresql', 'HOST': 'localhost', 'NAME': 'lunes', 'OPTIONS': {}, 'PASSWORD': 'password', 'PORT': '5432', 'TEST': {'CHARSET': None, 'COLLATION': None, 'MIGRATE': True, 'MIRROR': None, 'NAME': None}, 'TIME_ZONE': None, 'USER': 'lunes'}}

A dictionary containing the settings for all databases to be used with this Django installation (see DATABASES)

{
    'default': {
        'ATOMIC_REQUESTS': False,
        'AUTOCOMMIT': True,
        'CONN_MAX_AGE': 0,
        'ENGINE': 'django.db.backends.postgresql',
        'HOST': 'localhost',
        'NAME': 'lunes',
        'OPTIONS': {},
        'PASSWORD': 'password',
        'PORT': '5432',
        'TEST': {
            'CHARSET': None,
            'COLLATION': None,
            'MIGRATE': True,
            'MIRROR': None,
            'NAME': None,
        },
        'TIME_ZONE': None,
        'USER': 'lunes',
    },
}
lunes_cms.core.settings.DATABASE_CHOICES = {'postgres': {'ATOMIC_REQUESTS': False, 'AUTOCOMMIT': True, 'CONN_MAX_AGE': 0, 'ENGINE': 'django.db.backends.postgresql', 'HOST': 'localhost', 'NAME': 'lunes', 'OPTIONS': {}, 'PASSWORD': 'password', 'PORT': '5432', 'TEST': {'CHARSET': None, 'COLLATION': None, 'MIGRATE': True, 'MIRROR': None, 'NAME': None}, 'TIME_ZONE': None, 'USER': 'lunes'}, 'sqlite': {'ENGINE': 'django.db.backends.sqlite3', 'NAME': '/home/docs/checkouts/readthedocs.org/user_builds/lunes-cms/envs/latest/lib/python3.9/site-packages/lunes_cms/db.sqlite3'}}

A dictionary containing the settings for all databases to be used with this Django installation (see DATABASES)

{
    'postgres': {
        'ATOMIC_REQUESTS': False,
        'AUTOCOMMIT': True,
        'CONN_MAX_AGE': 0,
        'ENGINE': 'django.db.backends.postgresql',
        'HOST': 'localhost',
        'NAME': 'lunes',
        'OPTIONS': {},
        'PASSWORD': 'password',
        'PORT': '5432',
        'TEST': {
            'CHARSET': None,
            'COLLATION': None,
            'MIGRATE': True,
            'MIRROR': None,
            'NAME': None,
        },
        'TIME_ZONE': None,
        'USER': 'lunes',
    },
    'sqlite': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': '/home/docs/checkouts/readthedocs.org/user_builds/lunes-cms/envs/latest/lib/python3.9/site-packages/lunes_cms/db.sqlite3',
    },
}
lunes_cms.core.settings.DEBUG = False

A boolean that turns on/off debug mode (see DEBUG)

Warning

Never deploy a site into production with DEBUG turned on!

lunes_cms.core.settings.DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'

Default primary key field type to use for models that don’t have a field with primary_key=True.

lunes_cms.core.settings.DEFAULT_FROM_EMAIL = 'keineantwort@lunes.app'

Default email address to use for various automated correspondence from the site manager(s) (see DEFAULT_FROM_EMAIL)

lunes_cms.core.settings.DEPS_LOG_LEVEL = 'WARN'

The log level for dependencies

lunes_cms.core.settings.EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'

The backend to use for sending emails (see EMAIL_BACKEND and Sending email)

lunes_cms.core.settings.EMAIL_HOST = 'localhost'

The host to use for sending email (see EMAIL_HOST)

lunes_cms.core.settings.EMAIL_HOST_PASSWORD = None

Password to use for the SMTP server defined in EMAIL_HOST (see EMAIL_HOST_PASSWORD). If empty, Django won’t attempt authentication.

lunes_cms.core.settings.EMAIL_HOST_USER = 'keineantwort@lunes.app'

Username to use for the SMTP server defined in EMAIL_HOST (see EMAIL_HOST_USER). If empty, Django won’t attempt authentication.

lunes_cms.core.settings.EMAIL_PORT = 587

Port to use for the SMTP server defined in EMAIL_HOST (see EMAIL_PORT)

lunes_cms.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)

lunes_cms.core.settings.EMAIL_USE_TLS = True

Whether to use a TLS (secure) connection when talking to the SMTP server. This is used for explicit TLS connections, generally on port 587. (see EMAIL_USE_TLS)

lunes_cms.core.settings.INSTALLED_APPS = ['lunes_cms.api', 'lunes_cms.cms', 'lunes_cms.help', 'jazzmin', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.messages', 'django.contrib.sessions', 'django.contrib.staticfiles', 'drf_spectacular', 'mptt', 'pydub', 'rest_framework', 'qr_code']

Enabled applications (see INSTALLED_APPS)

[
    'lunes_cms.api',
    'lunes_cms.cms',
    'lunes_cms.help',
    'jazzmin',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.messages',
    'django.contrib.sessions',
    'django.contrib.staticfiles',
    'drf_spectacular',
    'mptt',
    'pydub',
    'rest_framework',
    'qr_code',
]
lunes_cms.core.settings.INTERNAL_IPS = ['localhost', '127.0.0.1']

A list of IP addresses, as strings, that allow the debug() context processor to add some variables to the template context.

['localhost', '127.0.0.1']
lunes_cms.core.settings.JAZZMIN_SETTINGS = {'changeform_format': 'collapsible', 'custom_css': 'css/corporate_identity.css', 'custom_js': 'js/corporate_identity.js', 'icons': {'auth.Group': 'fas fa-users', 'auth.user': 'fas fa-user-edit', 'cms.Discipline': 'fas fa-book', 'cms.Document': 'fab fa-amilia', 'cms.Feedback': 'fas fa-comment', 'cms.GroupAPIKey': 'fas fa-key', 'cms.Sponsor': 'fas fa-star', 'cms.TrainingSet': 'fas fa-stream'}, 'language_chooser': True, 'login_logo': 'images/logo-lunes.svg', 'login_logo_dark': 'images/logo-lunes-dark.svg', 'site_brand': 'Lunes Administration', 'site_header': 'Lunes Administration', 'site_icon': 'images/logo.svg', 'site_logo': 'images/logo.svg', 'site_logo_classes': '', 'site_title': 'Lunes Administration', 'welcome_sign': 'Welcome to the vocabulary management of Lunes!'}

Basic settings for Django Jazzmin

{
    'changeform_format': 'collapsible',
    'custom_css': 'css/corporate_identity.css',
    'custom_js': 'js/corporate_identity.js',
    'icons': {
        'auth.Group': 'fas fa-users',
        'auth.user': 'fas fa-user-edit',
        'cms.Discipline': 'fas fa-book',
        'cms.Document': 'fab fa-amilia',
        'cms.Feedback': 'fas fa-comment',
        'cms.GroupAPIKey': 'fas fa-key',
        'cms.Sponsor': 'fas fa-star',
        'cms.TrainingSet': 'fas fa-stream',
    },
    'language_chooser': True,
    'login_logo': 'images/logo-lunes.svg',
    'login_logo_dark': 'images/logo-lunes-dark.svg',
    'site_brand': 'Lunes Administration',
    'site_header': 'Lunes Administration',
    'site_icon': 'images/logo.svg',
    'site_logo': 'images/logo.svg',
    'site_logo_classes': '',
    'site_title': 'Lunes Administration',
    'welcome_sign': 'Welcome to the vocabulary management of Lunes!',
}
lunes_cms.core.settings.JAZZMIN_UI_TWEAKS = {'accent': 'accent-navy', 'body_small_text': False, 'brand_colour': 'navbar-dark', 'brand_small_text': False, 'button_classes': {'danger': 'btn-danger', 'info': 'btn-info', 'primary': 'btn-primary', 'secondary': 'btn-secondary', 'success': 'btn-success', 'warning': 'btn-warning'}, 'dark_mode_theme': 'darkly', 'footer_fixed': False, 'footer_small_text': False, 'layout_boxed': False, 'navbar': 'navbar-primary navbar-dark', 'navbar_fixed': False, 'navbar_small_text': False, 'no_navbar_border': True, 'sidebar': 'sidebar-dark-primary', 'sidebar_disable_expand': False, 'sidebar_fixed': False, 'sidebar_nav_child_indent': False, 'sidebar_nav_compact_style': False, 'sidebar_nav_flat_style': False, 'sidebar_nav_legacy_style': True, 'sidebar_nav_small_text': False}

UI tweaks for Django Jazzmin

{
    'accent': 'accent-navy',
    'body_small_text': False,
    'brand_colour': 'navbar-dark',
    'brand_small_text': False,
    'button_classes': {
        'danger': 'btn-danger',
        'info': 'btn-info',
        'primary': 'btn-primary',
        'secondary': 'btn-secondary',
        'success': 'btn-success',
        'warning': 'btn-warning',
    },
    'dark_mode_theme': 'darkly',
    'footer_fixed': False,
    'footer_small_text': False,
    'layout_boxed': False,
    'navbar': 'navbar-primary navbar-dark',
    'navbar_fixed': False,
    'navbar_small_text': False,
    'no_navbar_border': True,
    'sidebar': 'sidebar-dark-primary',
    'sidebar_disable_expand': False,
    'sidebar_fixed': False,
    'sidebar_nav_child_indent': False,
    'sidebar_nav_compact_style': False,
    'sidebar_nav_flat_style': False,
    'sidebar_nav_legacy_style': True,
    'sidebar_nav_small_text': False,
}
lunes_cms.core.settings.LANGUAGES = [('en', 'English'), ('de', 'German')]

A list of all available languages (see LANGUAGES and Internationalization and localization)

[('en', 'English'), ('de', 'German')]
lunes_cms.core.settings.LANGUAGE_CODE = 'en'

A string representing the language slug for this installation (see LANGUAGE_CODE and Internationalization and localization)

lunes_cms.core.settings.LOCALE_PATHS = ['/home/docs/checkouts/readthedocs.org/user_builds/lunes-cms/envs/latest/lib/python3.9/site-packages/lunes_cms/locale']

A list of directories where Django looks for translation files (see LOCALE_PATHS and Internationalization and localization)

[
    '/home/docs/checkouts/readthedocs.org/user_builds/lunes-cms/envs/latest/lib/python3.9/site-packages/lunes_cms/locale',
]
lunes_cms.core.settings.LOGFILE = '/home/docs/checkouts/readthedocs.org/user_builds/lunes-cms/envs/latest/lib/python3.9/site-packages/lunes_cms/lunes-cms.log'

The file path of the logfile. Needs to be writable by the application.

lunes_cms.core.settings.LOGGING = {'disable_existing_loggers': False, 'filters': {'require_debug_false': {'()': 'django.utils.log.RequireDebugFalse'}, 'require_debug_true': {'()': 'django.utils.log.RequireDebugTrue'}}, 'formatters': {'console': {'datefmt': '%b %d %H:%M:%S', 'format': '{asctime} \x1b[1m{levelname}\x1b[0m {name} - {message}', 'style': '{'}, 'console-colored': {'()': <class 'lunes_cms.core.logging_formatter.ColorFormatter'>, 'datefmt': '%b %d %H:%M:%S', 'format': '{asctime} {levelname} {name} - {message}', 'style': '{'}, 'email': {'datefmt': '%Y-%m-%d %H:%M:%S', 'format': 'Date and time: {asctime}\nSeverity: {levelname}\nLogger: {name}\nMessage: {message}\nFile: {funcName}() in {pathname}:{lineno}', 'style': '{'}, 'logfile': {'datefmt': '%b %d %H:%M:%S', 'format': '{asctime} {levelname:7} {name} - {message}', 'style': '{'}, 'syslog': {'format': 'LUNES CMS - {levelname}: {message}', 'style': '{'}}, 'handlers': {'authlog': {'address': '/dev/log', 'class': 'logging.handlers.SysLogHandler', 'facility': 'auth', 'filters': ['require_debug_false'], 'formatter': 'syslog'}, 'console': {'class': 'logging.StreamHandler', 'filters': ['require_debug_true'], 'formatter': 'console'}, 'console-colored': {'class': 'logging.StreamHandler', 'filters': ['require_debug_true'], 'formatter': 'console-colored'}, 'logfile': {'class': 'logging.FileHandler', 'filename': '/home/docs/checkouts/readthedocs.org/user_builds/lunes-cms/envs/latest/lib/python3.9/site-packages/lunes_cms/lunes-cms.log', 'formatter': 'logfile'}, 'syslog': {'address': '/dev/log', 'class': 'logging.handlers.SysLogHandler', 'facility': 'syslog', 'filters': ['require_debug_false']}}, 'loggers': {'': {'handlers': ['console', 'logfile'], 'level': 'WARN', 'propagate': True}, 'auth': {'handlers': ['console', 'logfile', 'authlog', 'syslog'], 'level': 'INFO', 'propagate': False}, 'django': {'handlers': ['console', 'logfile'], 'level': 'WARN', 'propagate': False}, 'lunes_cms': {'handlers': ['console-colored', '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': {
            'datefmt': '%b %d %H:%M:%S',
            'format': '{asctime} \x1b[1m{levelname}\x1b[0m {name} - {message}',
            'style': '{',
        },
        'console-colored': {
            '()': <class 'lunes_cms.core.logging_formatter.ColorFormatter'>,
            'datefmt': '%b %d %H:%M:%S',
            'format': '{asctime} {levelname} {name} - {message}',
            'style': '{',
        },
        'email': {
            'datefmt': '%Y-%m-%d %H:%M:%S',
            'format': 'Date and time: {asctime}\nSeverity: {levelname}\nLogger: {name}\nMessage: {message}\nFile: {funcName}() in {pathname}:{lineno}',
            'style': '{',
        },
        'logfile': {
            'datefmt': '%b %d %H:%M:%S',
            'format': '{asctime} {levelname:7} {name} - {message}',
            'style': '{',
        },
        'syslog': {
            'format': 'LUNES CMS - {levelname}: {message}',
            'style': '{',
        },
    },
    'handlers': {
        'authlog': {
            'address': '/dev/log',
            'class': 'logging.handlers.SysLogHandler',
            'facility': 'auth',
            'filters': ['require_debug_false'],
            'formatter': 'syslog',
        },
        'console': {
            'class': 'logging.StreamHandler',
            'filters': ['require_debug_true'],
            'formatter': 'console',
        },
        'console-colored': {
            'class': 'logging.StreamHandler',
            'filters': ['require_debug_true'],
            'formatter': 'console-colored',
        },
        'logfile': {
            'class': 'logging.FileHandler',
            'filename': '/home/docs/checkouts/readthedocs.org/user_builds/lunes-cms/envs/latest/lib/python3.9/site-packages/lunes_cms/lunes-cms.log',
            'formatter': 'logfile',
        },
        'syslog': {
            'address': '/dev/log',
            'class': 'logging.handlers.SysLogHandler',
            'facility': 'syslog',
            'filters': ['require_debug_false'],
        },
    },
    'loggers': {
        '': {'handlers': ['console', 'logfile'], 'level': 'WARN', 'propagate': True},
        'auth': {'handlers': ['console', 'logfile', 'authlog', 'syslog'], 'level': 'INFO', 'propagate': False},
        'django': {'handlers': ['console', 'logfile'], 'level': 'WARN', 'propagate': False},
        'lunes_cms': {'handlers': ['console-colored', 'logfile'], 'level': 'INFO', 'propagate': False},
    },
    'version': 1,
}
lunes_cms.core.settings.LOGIN_REDIRECT_URL = '/admin/'

The URL or named URL pattern where requests are redirected after login when the LoginView doesn’t get a next GET parameter. (see LOGIN_REDIRECT_URL).

lunes_cms.core.settings.LOGIN_URL = '/admin/login/'

The URL or named URL pattern where requests are redirected for login (see LOGIN_URL)

lunes_cms.core.settings.LOG_LEVEL = 'INFO'

The log level for lunes-cms django apps

lunes_cms.core.settings.MEDIA_ROOT = '/home/docs/checkouts/readthedocs.org/user_builds/lunes-cms/envs/latest/lib/python3.9/site-packages/lunes_cms/media'

Absolute filesystem path to the directory that will hold user-uploaded files (see MEDIA_ROOT)

lunes_cms.core.settings.MEDIA_URL = '/media/'

URL that handles the media served from MEDIA_ROOT (see MEDIA_URL)

lunes_cms.core.settings.MIDDLEWARE = ['django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware']

Activated middlewares (see MIDDLEWARE)

[
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.locale.LocaleMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
lunes_cms.core.settings.REST_FRAMEWORK = {'ALLOWED_VERSIONS': ('v1', 'v2'), 'DEFAULT_API_URL': 'http://localhost:8080/api/', 'DEFAULT_SCHEMA_CLASS': 'drf_spectacular.openapi.AutoSchema', 'DEFAULT_VERSION': 'default', 'DEFAULT_VERSIONING_CLASS': 'rest_framework.versioning.NamespaceVersioning'}

Configuration of Django REST Framework

{
    'ALLOWED_VERSIONS': ('v1', 'v2'),
    'DEFAULT_API_URL': 'http://localhost:8080/api/',
    'DEFAULT_SCHEMA_CLASS': 'drf_spectacular.openapi.AutoSchema',
    'DEFAULT_VERSION': 'default',
    'DEFAULT_VERSIONING_CLASS': 'rest_framework.versioning.NamespaceVersioning',
}
lunes_cms.core.settings.ROOT_URLCONF = 'lunes_cms.core.urls'

Default URL dispatcher (see ROOT_URLCONF)

lunes_cms.core.settings.SECRET_KEY = 'dummy'

The secret key for this particular Django installation (see SECRET_KEY)

Warning

Provide a key via the environment variable LUNES_CMS_SECRET_KEY in production and keep it secret!

lunes_cms.core.settings.SERVER_EMAIL = 'keineantwort@lunes.app'

The email address that error messages come from, such as those sent to ADMINS. (see SERVER_EMAIL)

lunes_cms.core.settings.STATICFILES_DIRS = ['/home/docs/checkouts/readthedocs.org/user_builds/lunes-cms/envs/latest/lib/python3.9/site-packages/lunes_cms/static']

This setting defines the additional locations the django.contrib.staticfiles app will traverse to collect static files for deployment or to serve them during development (see STATICFILES_DIRS and Managing static files).

[
    '/home/docs/checkouts/readthedocs.org/user_builds/lunes-cms/envs/latest/lib/python3.9/site-packages/lunes_cms/static',
]
lunes_cms.core.settings.STATIC_ROOT = None

The absolute path to the output directory where django.contrib.staticfiles will put static files for deployment (see STATIC_ROOT and Managing static files) In debug mode, this is not required since django.contrib.staticfiles can directly serve these files.

lunes_cms.core.settings.STATIC_URL = '/static/'

URL to use in development when referring to static files located in STATICFILES_DIRS (see STATIC_URL and Managing static files)

lunes_cms.core.settings.SYS_LOG_LEVEL = 'INFO'

The log level for the syslog

lunes_cms.core.settings.TEMPLATES = [{'APP_DIRS': True, 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], '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', 'lunes_cms.core.context_processors.feedback_processor']}}]

Config for HTML templates (see TEMPLATES)

[
    {
        'APP_DIRS': True,
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        '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',
                'lunes_cms.core.context_processors.feedback_processor',
            ],
        },
    },
]
lunes_cms.core.settings.TIME_ZONE = 'UTC'

A string representing the time zone for this installation (see TIME_ZONE and Internationalization and localization)

lunes_cms.core.settings.TRAININGSET_MIN_DOCS = 4

How many documents a training sets needs at least to get released

lunes_cms.core.settings.USE_I18N = True

A boolean that specifies whether Django’s translation system should be enabled (see USE_I18N and Internationalization and localization)

lunes_cms.core.settings.USE_L10N = True

A boolean that specifies if localized formatting of data will be enabled by default or not (see USE_L10N and Internationalization and localization)

lunes_cms.core.settings.USE_TZ = True

A boolean that specifies if datetimes will be timezone-aware by default or not (see USE_TZ and Internationalization and localization)

lunes_cms.core.settings.WSGI_APPLICATION = 'lunes_cms.core.wsgi.application'

WSGI (Web Server Gateway Interface) config (see WSGI_APPLICATION)

Urls

Lunes CMS URL Configuration

The urlpatterns list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.2/topics/http/urls/

Examples:

Function views
  1. Add an import: from my_app import views

  2. Add a URL to urlpatterns: path(‘’, views.home, name=’home’)

Class-based views
  1. Add an import: from other_app.views import Home

  2. Add a URL to urlpatterns: path(‘’, Home.as_view(), name=’home’)

Including another URLconf
  1. Import the include() function: from django.urls import include, path

  2. Add a URL to urlpatterns: path(‘blog/’, include(‘blog.urls’))

lunes_cms.core.urls.urlpatterns = [<URLPattern ''>, <URLPattern 'favicon.ico'>, <URLResolver <module 'lunes_cms.api.urls' from '/home/docs/checkouts/readthedocs.org/user_builds/lunes-cms/envs/latest/lib/python3.9/site-packages/lunes_cms/api/urls.py'> (api:api) 'api/'>, <URLResolver <module 'lunes_cms.help.urls' from '/home/docs/checkouts/readthedocs.org/user_builds/lunes-cms/envs/latest/lib/python3.9/site-packages/lunes_cms/help/urls.py'> (None:None) ''>, <URLResolver <module 'django.conf.urls.i18n' from '/home/docs/checkouts/readthedocs.org/user_builds/lunes-cms/envs/latest/lib/python3.9/site-packages/django/conf/urls/i18n.py'> (None:None) '^i18n/'>, <URLResolver <module 'qr_code.urls' from '/home/docs/checkouts/readthedocs.org/user_builds/lunes-cms/envs/latest/lib/python3.9/site-packages/qr_code/urls.py'> (qr_code:qr_code) 'qr_code/'>, <URLResolver <URLResolver list> (None:None) 'en/'>]

The url patterns of this module (see URL dispatcher)

[
    <URLPattern ''>,
    <URLPattern 'favicon.ico'>,
    <URLResolver <module 'lunes_cms.api.urls' from '/home/docs/checkouts/readthedocs.org/user_builds/lunes-cms/envs/latest/lib/python3.9/site-packages/lunes_cms/api/urls.py'> (api:api) 'api/'>,
    <URLResolver <module 'lunes_cms.help.urls' from '/home/docs/checkouts/readthedocs.org/user_builds/lunes-cms/envs/latest/lib/python3.9/site-packages/lunes_cms/help/urls.py'> (None:None) ''>,
    <URLResolver <module 'django.conf.urls.i18n' from '/home/docs/checkouts/readthedocs.org/user_builds/lunes-cms/envs/latest/lib/python3.9/site-packages/django/conf/urls/i18n.py'> (None:None) '^i18n/'>,
    <URLResolver <module 'qr_code.urls' from '/home/docs/checkouts/readthedocs.org/user_builds/lunes-cms/envs/latest/lib/python3.9/site-packages/qr_code/urls.py'> (qr_code:qr_code) 'qr_code/'>,
    <URLResolver <URLResolver list> (None:None) 'en/'>,
]

Wsgi

WSGI config for lunes-cms 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/2.2/howto/deployment/wsgi/

lunes_cms.core.wsgi.application(environ, start_response)

This returns the WSGI callable

Parameters:
  • environ (dict) – The environment variables

  • start_response (Callable) – A function which starts the response

Returns:

The WSGI callable

Return type:

WSGIHandler