mirror of
https://github.com/retspen/webvirtcloud
synced 2025-01-26 07:05:19 +00:00
168 lines
3.8 KiB
Text
168 lines
3.8 KiB
Text
"""
|
|
Django settings for webvirtcloud project.
|
|
|
|
"""
|
|
|
|
import os
|
|
|
|
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
|
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
|
|
SECRET_KEY = ''
|
|
|
|
DEBUG = True
|
|
|
|
ALLOWED_HOSTS = ['*']
|
|
|
|
# Application definition
|
|
INSTALLED_APPS = [
|
|
'django.contrib.auth',
|
|
'django.contrib.contenttypes',
|
|
'django.contrib.sessions',
|
|
'django.contrib.messages',
|
|
'django.contrib.staticfiles',
|
|
'bootstrap4',
|
|
'fa',
|
|
'accounts',
|
|
'admin',
|
|
'computes',
|
|
'console',
|
|
'create',
|
|
'datasource',
|
|
'networks',
|
|
'instances',
|
|
'interfaces',
|
|
'nwfilters',
|
|
'storages',
|
|
'secrets',
|
|
'appsettings',
|
|
'logs',
|
|
]
|
|
|
|
MIDDLEWARE = [
|
|
'django.middleware.security.SecurityMiddleware',
|
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
|
'django.middleware.common.CommonMiddleware',
|
|
'django.middleware.csrf.CsrfViewMiddleware',
|
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
|
'login_required.middleware.LoginRequiredMiddleware',
|
|
'django.contrib.auth.middleware.RemoteUserMiddleware',
|
|
'django.contrib.messages.middleware.MessageMiddleware',
|
|
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
|
'django.middleware.locale.LocaleMiddleware',
|
|
]
|
|
|
|
ROOT_URLCONF = 'webvirtcloud.urls'
|
|
|
|
TEMPLATES = [
|
|
{
|
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
|
'DIRS': [
|
|
os.path.join(BASE_DIR, 'templates'),
|
|
],
|
|
'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',
|
|
],
|
|
'libraries': {
|
|
'common_tags': 'webvirtcloud.common_tags',
|
|
},
|
|
},
|
|
},
|
|
]
|
|
|
|
WSGI_APPLICATION = 'webvirtcloud.wsgi.application'
|
|
|
|
# Database
|
|
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
|
|
|
|
DATABASES = {
|
|
'default': {
|
|
'ENGINE': 'django.db.backends.sqlite3',
|
|
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
|
|
}
|
|
}
|
|
|
|
AUTHENTICATION_BACKENDS = [
|
|
'django.contrib.auth.backends.ModelBackend',
|
|
]
|
|
|
|
LOGIN_URL = '/accounts/login/'
|
|
|
|
LOGOUT_REDIRECT_URL = '/accounts/login/'
|
|
|
|
LANGUAGE_CODE = 'en-us'
|
|
|
|
TIME_ZONE = 'UTC'
|
|
|
|
USE_I18N = True
|
|
|
|
USE_L10N = True
|
|
|
|
USE_TZ = True
|
|
|
|
STATIC_URL = '/static/'
|
|
|
|
STATICFILES_DIRS = [
|
|
os.path.join(BASE_DIR, "static"),
|
|
]
|
|
|
|
LOGGING = {
|
|
"version": 1,
|
|
"disable_existing_loggers": False,
|
|
"handlers": {
|
|
"mail_admins": {
|
|
"level": "ERROR",
|
|
"class": "django.utils.log.AdminEmailHandler"
|
|
}
|
|
},
|
|
"loggers": {
|
|
"django.request": {
|
|
"handlers": ["mail_admins"],
|
|
"level": "ERROR",
|
|
"propagate": True
|
|
}
|
|
},
|
|
}
|
|
|
|
#
|
|
# WebVirtCloud settings
|
|
#
|
|
|
|
# Websock port
|
|
WS_PORT = 6080
|
|
|
|
# Websock host
|
|
WS_HOST = '0.0.0.0'
|
|
|
|
# Websock public port - 80 or 443 if reverse-proxy, else 6080
|
|
WS_PUBLIC_PORT = 6080
|
|
|
|
# Websock public host
|
|
WS_PUBLIC_HOST = None
|
|
|
|
# Websock SSL connection
|
|
WS_CERT = None
|
|
|
|
# List of console listen addresses
|
|
QEMU_CONSOLE_LISTEN_ADDRESSES = (
|
|
('127.0.0.1', 'Localhost'),
|
|
('0.0.0.0', 'All interfaces'),
|
|
)
|
|
|
|
# List taken from http://qemu.weilnetz.de/qemu-doc.html#sec_005finvocation
|
|
QEMU_KEYMAPS = ['ar', 'da', 'de', 'de-ch', 'en-gb', 'en-us', 'es', 'et', 'fi',
|
|
'fo', 'fr', 'fr-be', 'fr-ca', 'fr-ch', 'hr', 'hu', 'is', 'it',
|
|
'ja', 'lt', 'lv', 'mk', 'nl', 'nl-be', 'no', 'pl', 'pt',
|
|
'pt-br', 'ru', 'sl', 'sv', 'th', 'tr']
|
|
|
|
# Keepalive interval and count for libvirt connections
|
|
LIBVIRT_KEEPALIVE_INTERVAL = 5
|
|
LIBVIRT_KEEPALIVE_COUNT = 5
|
|
|
|
NEW_USER_DEFAULT_INSTANCES = []
|
|
|