diff --git a/webvirt/settings.py.template b/webvirt/settings.py.template index 85450db..9b35347 100644 --- a/webvirt/settings.py.template +++ b/webvirt/settings.py.template @@ -1,17 +1,32 @@ """ Django settings for webvirt 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/ """ import os + +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(__file__)) + +# SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = '' +# SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = ['*'] + +# Application definition + INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', @@ -33,51 +48,20 @@ INSTALLED_APPS = ( 'datasource', ) -MIDDLEWARE_CLASSES = ( +MIDDLEWARE = [ + # 'django.middleware.security.SecurityMiddleware', # deleted 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.auth.middleware.RemoteUserMiddleware', - 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', + 'django.contrib.auth.middleware.RemoteUserMiddleware', # added + 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', # added 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', -) - -AUTHENTICATION_BACKENDS = ( - 'django.contrib.auth.backends.ModelBackend', - #'django.contrib.auth.backends.RemoteUserBackend', -) - -LOGIN_URL = '/accounts/login' +] ROOT_URLCONF = 'webvirt.urls' -WSGI_APPLICATION = 'webvirt.wsgi.application' - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), - } -} - -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"), -) - TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', @@ -94,7 +78,64 @@ TEMPLATES = [ }, ] -## WebVirtCloud settings +WSGI_APPLICATION = 'webvirt.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/2.2/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + } +} + + +# Password validation +# https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators + +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', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/2.2/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_L10N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/2.2/howto/static-files/ + +STATIC_URL = '/static/' + +STATICFILES_DIRS = [ + os.path.join(BASE_DIR, "static"), +] + + +## WebVirt settings # Wobsock port WS_PORT = 6080