1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2025-07-31 12:41:08 +00:00

Django 3.2.4 LTS upgrade

This commit is contained in:
catborise 2021-06-15 09:42:55 +03:00 committed by catborise
parent d7c0f9445d
commit 5aa22ac042
28 changed files with 58 additions and 28 deletions

View file

@ -3,10 +3,10 @@ Django settings for webvirtcloud project.
"""
import os
from pathlib import Path
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = ""
@ -63,7 +63,7 @@ TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [
os.path.join(BASE_DIR, "templates"),
Path.joinpath(BASE_DIR, "templates"),
],
"APP_DIRS": True,
"OPTIONS": {
@ -83,6 +83,7 @@ TEMPLATES = [
WSGI_APPLICATION = "webvirtcloud.wsgi.application"
# Settings for django-icons
DJANGO_ICONS = {
@ -96,19 +97,20 @@ DJANGO_ICONS = {
},
}
# 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"),
"NAME": Path.joinpath(BASE_DIR, "db.sqlite3"),
}
}
AUTHENTICATION_BACKENDS = [
"django.contrib.auth.backends.ModelBackend",
"webvirtcloud.ldapbackend.LdapAuthenticationBackend",
#"webvirtcloud.ldapbackend.LdapAuthenticationBackend",
]
LOGIN_URL = "/accounts/login/"
@ -128,13 +130,35 @@ USE_TZ = True
STATIC_URL = "/static/"
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static"),
Path.joinpath(BASE_DIR, "static"),
]
# Default primary key field type
# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
LOCALE_PATHS = [
"locale/",
]
# Settings for django-icons
DJANGO_ICONS = {
'DEFAULTS': {
'renderer': 'fontawesome4',
},
'RENDERERS': {
'fontawesome4': 'FontAwesome4Renderer',
'bootstrap3': 'Bootstrap3Renderer',
},
}
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
@ -150,6 +174,7 @@ LOGGING = {
},
}
#
# WebVirtCloud settings
#
@ -223,10 +248,15 @@ ALLOW_EMPTY_PASSWORD = False
NEW_USER_DEFAULT_INSTANCES = []
SHOW_PROFILE_EDIT_PASSWORD = True
# OTP Config
OTP_ENABLED = False
LOGIN_REQUIRED_IGNORE_VIEW_NAMES = ["accounts:login", "accounts:email_otp"]
# LDAP Config
#
LDAP_ENABLED = False
LDAP_URL = ''
LDAP_PORT = 389