From b39f67a8aca25afba6ae511afa0188157d9d2266 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Wed, 6 Dec 2023 16:44:34 +0530 Subject: [PATCH] Update settings --- dynamicweb2/settings.py | 67 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 65 insertions(+), 2 deletions(-) diff --git a/dynamicweb2/settings.py b/dynamicweb2/settings.py index f1f4614..4f45908 100644 --- a/dynamicweb2/settings.py +++ b/dynamicweb2/settings.py @@ -13,6 +13,7 @@ import dotenv import os from pathlib import Path +from django.utils.translation import gettext_lazy as _ # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent @@ -41,8 +42,19 @@ INSTALLED_APPS = [ 'django.contrib.staticfiles', 'django.contrib.sites', 'bootstrap3', + 'compressor', 'guardian', 'hosting', + 'membership', + 'utils', + 'cms', + 'menus', + 'easy_thumbnails', + 'treebeard', + 'filer', + 'datacenterlight', + 'opennebula_api', + 'sekizai' ] MIDDLEWARE = [ @@ -53,6 +65,7 @@ MIDDLEWARE = [ 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', + 'django.middleware.locale.LocaleMiddleware', ] ROOT_URLCONF = 'dynamicweb2.urls' @@ -76,7 +89,7 @@ TEMPLATES = [ "django.template.context_processors.static", # Updated import "django.template.context_processors.tz", # Updated import "django.contrib.messages.context_processors.messages", - 'hosting.context_processor.google_analytics', + 'sekizai.context_processors.sekizai', ], }, }, @@ -137,6 +150,7 @@ STATIC_ROOT = os.path.join(PROJECT_DIR, 'static') STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', + 'compressor.finders.CompressorFinder' ) # Default primary key field type @@ -184,7 +198,7 @@ STRIPE_API_PRIVATE_KEY_TEST = env('STRIPE_API_PRIVATE_KEY_TEST') GUARDIAN_GET_INIT_ANONYMOUS_USER = 'hosting.models.get_anonymous_user_instance' -AUTH_USER_MODEL = 'hosting.CustomUser' +AUTH_USER_MODEL = 'membership.CustomUser' AUTHENTICATION_BACKENDS = ( 'dynamicweb2.backend.UngleichLDAPBackend', @@ -271,3 +285,52 @@ VM_BASE_PRICE = float(env('VM_BASE_PRICE')) # # Handle the case where the site doesn't exist # pass +# The oneadmin user name of the OpenNebula infrastructure +OPENNEBULA_USERNAME = env('OPENNEBULA_USERNAME') + +# The oneadmin password of the OpenNebula infrastructure +# The default credentials of the Sandbox OpenNebula VM is +# oneadmin:opennebula +OPENNEBULA_PASSWORD = env('OPENNEBULA_PASSWORD') + +# The protocol is generally http or https +OPENNEBULA_PROTOCOL = env('OPENNEBULA_PROTOCOL') + +# The ip address or the domain name of the opennebula infrastructure +OPENNEBULA_DOMAIN = env('OPENNEBULA_DOMAIN') + +# The port to connect in order to send an xmlrpc request. The default +# port is 2633 +OPENNEBULA_PORT = env('OPENNEBULA_PORT') + +# The endpoint to which the XML RPC request needs to be sent to. The +# default value is /RPC2 +OPENNEBULA_ENDPOINT = env('OPENNEBULA_ENDPOINT') + +# The public ssh key of the oneadmin user +ONEADMIN_USER_SSH_PUBLIC_KEY = env('ONEADMIN_USER_SSH_PUBLIC_KEY') + +CELERY_MAX_RETRIES = 1 + +BYPASS_OPENNEBULA = True + +SITE_ID = 1 + +ANONYMOUS_USER_NAME = 'anonymous@ungleich.ch' + +GUARDIAN_GET_INIT_ANONYMOUS_USER = 'membership.models.get_anonymous_user_instance' + +LANGUAGES = ( + ('en-us', _('English')), + ('de', _('Deutsch')), +) + +LANGUAGE_CODE = 'en-us' + +USE_I18N = True + +USE_L10N = True + +LOCALE_PATHS = [ + os.path.join(PROJECT_DIR, 'locale'), +] \ No newline at end of file