diff --git a/server/.env.example b/server/.env.example new file mode 100644 index 0000000..1ace904 --- /dev/null +++ b/server/.env.example @@ -0,0 +1,14 @@ +# Environment Settings +# Use core.config.local for Dev environment and core.config.production for production environment +DJANGO_SETTINGS_MODULE='core.config.local' + +# Sqlite3 database config +SECRET_KEY='paste db.sqlite3 key here' + +# Production Env Database config +# PostgreSql Credentials +DB_NAME= +DB_USER= +DB_PASS= +DB_HOST=localhost +DB_PORT=5432 diff --git a/server/core/asgi.py b/server/core/asgi.py index 2eee894..2aa209a 100644 --- a/server/core/asgi.py +++ b/server/core/asgi.py @@ -8,9 +8,12 @@ """ import os +from dotenv import load_dotenv + +load_dotenv() from django.core.asgi import get_asgi_application -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'main2077cms.settings') +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'core.config.local') application = get_asgi_application() diff --git a/server/core/config/__init__.py b/server/core/config/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/server/core/config/base.py b/server/core/config/base.py new file mode 100644 index 0000000..8055c1e --- /dev/null +++ b/server/core/config/base.py @@ -0,0 +1,187 @@ +""" +Django settings for core project. + +Generated by 'django-admin startproject' using Django 5.0.7. + +For more information on this file, see +https://docs.djangoproject.com/en/5.0/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/5.0/ref/settings/ +""" + +import os +from pathlib import Path +from dotenv import load_dotenv + +load_dotenv() +from decouple import config + +# Build paths inside the project like this: BASE_DIR / 'subdir'. +BASE_DIR = Path(__file__).resolve().parent.parent + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = config('SECRET_KEY') + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = bool(config('DJANGO_DEBUG', default=True)) + +ALLOWED_HOSTS = ["*"] + +# Application definition + +DJANGO_APPS = [ + 'jazzmin', + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'rest_framework', +] + +LOCAL_APPS = [ + 'apps.common', + 'apps.research', +] + +THIRD_PARTY_APPS = [ + 'corsheaders', + 'ckeditor_uploader', + 'django_ckeditor_5', +] + +INSTALLED_APPS = DJANGO_APPS + LOCAL_APPS + THIRD_PARTY_APPS + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'whitenoise.middleware.WhiteNoiseMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'corsheaders.middleware.CorsMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +REST_FRAMEWORK = { + 'DEFAULT_PERMISSION_CLASSES': [ + 'rest_framework.permissions.IsAuthenticatedOrReadOnly', + ], + "NON_FIELD_ERRORS_KEY": "error", + +} +# Possible Permissions to explore based on use case +# 'rest_framework.permissions.AllowAny', +# 'rest_framework.permissions.IsAuthenticated', +# 'rest_framework.permissions.IsAdminUser', +# 'rest_framework.permissions.IsAuthenticatedOrReadOnly', + +CORS_ALLOWED_ORIGINS = [ + "http://localhost:3000", + "http://127.0.0.1:8000", +] + + +ROOT_URLCONF = 'core.urls' + +# configured to serve static files +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [ + BASE_DIR / '../../client/build', + 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', + ], + }, + }, +] + +WSGI_APPLICATION = 'core.wsgi.application' + +# Database +# https://docs.djangoproject.com/en/5.0/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': BASE_DIR / 'db.sqlite3', + } +} + +# Password validation +# https://docs.djangoproject.com/en/5.0/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/5.0/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_TZ = True + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/5.0/howto/static-files/ + +STATIC_URL = '/static/' +STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') +MEDIA_URL = '/media/' + +MEDIA_ROOT = os.path.join(BASE_DIR, 'media') + +STATICFILES_DIRS = [ + '../client/build/static/', + os.path.join(BASE_DIR, 'static'), +] + +STORAGES = { + "default": { + "BACKEND": "django.core.files.storage.FileSystemStorage", + }, + "staticfiles": { + "BACKEND": "whitenoise.storage.CompressedStaticFilesStorage", + }, +} + +# Default primary key field type +# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' + +SILENCED_SYSTEM_CHECKS = [ + "staticfiles.W004" +] + +from .jazzmin import * +from .ckeditor import * diff --git a/server/core/config/ckeditor.py b/server/core/config/ckeditor.py new file mode 100644 index 0000000..1cfcaac --- /dev/null +++ b/server/core/config/ckeditor.py @@ -0,0 +1,73 @@ +# CKEDITOR CONFIGS +CKEDITOR_UPLOAD_PATH = "ckeditor_uploads/" + +CKEDITOR_IMAGE_BACKEND = "pillow" + +customColorPalette = [ + { + 'color': 'hsl(4, 90%, 58%)', + 'label': 'Red' + }, + { + 'color': 'hsl(340, 82%, 52%)', + 'label': 'Pink' + }, + { + 'color': 'hsl(291, 64%, 42%)', + 'label': 'Purple' + }, + { + 'color': 'hsl(262, 52%, 47%)', + 'label': 'Deep Purple' + }, + { + 'color': 'hsl(231, 48%, 48%)', + 'label': 'Indigo' + }, + { + 'color': 'hsl(207, 90%, 54%)', + 'label': 'Blue' + }, +] + +CKEDITOR_5_CONFIGS = { + 'default': { + 'toolbar': ['undo', 'redo', '|', 'heading', '|', 'bold', 'italic', 'underline', 'strikethrough', 'link', 'horizontalLine', '|', 'fontsize', + 'fontfamily', 'fontColor', 'fontBackgroundColor', '|', 'alignment', 'outdent', 'indent', + 'linespacing', '|', + 'bulletedList', 'numberedList', 'findAndReplace', 'highlight', 'subscript', 'superscript', + 'specialCharacters', '|', 'imageInsert', 'code', 'codeBlock', 'insertTable', 'mediaEmbed', '|', + 'blockQuote', 'fullscreen', 'removeFormat'], + + 'image': { + 'toolbar': ['imageTextAlternative', '|', 'imageStyle:alignLeft', + 'imageStyle:alignRight', 'imageStyle:alignCenter', 'imageStyle:side', 'imageResize', '|'], + 'styles': [ + 'full', + 'side', + 'alignLeft', + 'alignRight', + 'alignCenter', + ] + },'blockToolbar': { + 'items': [ + 'paragraph', 'heading1', 'heading2', 'heading3', + '|', + 'bulletedList', 'numberedList', + '|', + 'blockQuote', + ], + 'location': 'left', # Position the block toolbar on the left + }, + }, + 'extends': { + + }, + 'list': { + 'properties': { + 'styles': 'true', + 'startIndex': 'true', + 'reversed': 'true', + } + } +} diff --git a/server/core/config/jazzmin.py b/server/core/config/jazzmin.py new file mode 100644 index 0000000..2e93bb9 --- /dev/null +++ b/server/core/config/jazzmin.py @@ -0,0 +1,97 @@ +JAZZMIN_SETTINGS = { + "site_brand": "2077 Collective Admin", + # title of the window (Will default to current_admin_site.site_title if absent or None) + "site_title": "2077 Collective Admin", + # Title on the login screen (19 chars max) (defaults to current_admin_site.site_header if absent or None) + "site_header": "2077 Collective", + # Logo to use for your site, must be present in static files, used for brand on top left + "site_logo": "../staticfiles/images/logo.png", + # Logo to use for your site, must be present in static files, used for login form logo (defaults to site_logo) + "login_logo": "../staticfiles/images/logo.png", + # CSS classes that are applied to the logo above + "site_logo_classes": "img-circle", + # Relative path to a favicon for your site, will default to site_logo if absent (ideally 32x32 px) + "site_icon": "../staticfiles/images/logo.img", + # Welcome text on the login screen + "welcome_sign": "Welcome to the 2077 Collective Admin Section", + # Copyright on the footer + "copyright": "2077 Collective Ltd", + # The model admin to search from the search bar, search bar omitted if excluded + "search_model": [], + # Field name on user model that contains avatar ImageField/URLField/Charfield or a callable that receives the user + # "user_avatar": "avatar", + + ############# + # User Menu # + ############# + # Additional links to include in the user menu on the top right ("app" url type is not allowed) + "usermenu_links": [{"name": "2077 Collective Platform"}, {"model": "core.user"}], + + ############# + # Side Menu # + ############# + # Whether to display the side menu + "show_sidebar": True, + # Whether to aut expand the menu + "navigation_expanded": True, + # Hide these apps when generating side menu e.g (auth) + "hide_apps": {"authtoken": ['tokenproxy'], "token_blacklist": ["blacklistedtoken", "outstandingtoken"]}, + # List of apps (and/or models) to base side menu ordering off of (does not need to contain all apps/models) + "order_with_respect_to": ["auth", "research"], + + "related_modal_active": False, + + "icons": { + "auth.group": "fas fa-users", + "auth.user": "fas fa-universal-access", + "research.article": "fas fa-newspaper", + "research.category": "fas fa-list", + }, + # Icons that are used when one is not manually specified + "default_icon_parents": "fas fa-chevron-circle-right", + "default_icon_children": "fas fa-circle", + + ############# + # UI Tweaks # + ############# + "changeform_format": "carousel", + # override change forms on a per modeladmin basis + "changeform_format_overrides": { + "auth.user": "collapsible", + "auth.group": "vertical_tabs", + "research.article": "horizontal_tabs_bottom_buttons", + }, +} + +JAZZMIN_UI_TWEAKS = { + "navbar_small_text": False, + "footer_small_text": False, + "body_small_text": False, + "brand_small_text": True, + "brand_colour": "navbar-teal", + "accent": "accent-navy", + "navbar": "navbar-teal navbar-dark", + "no_navbar_border": True, + "navbar_fixed": False, + "layout_boxed": False, + "footer_fixed": False, + "sidebar_fixed": False, + "sidebar": "sidebar-light-teal", + "sidebar_nav_small_text": False, + "sidebar_disable_expand": False, + "sidebar_nav_child_indent": False, + "sidebar_nav_compact_style": False, + "sidebar_nav_legacy_style": False, + "sidebar_nav_flat_style": False, + "theme": "yeti", + "dark_mode_theme": "darkly", + "button_classes": { + "primary": "btn-outline-primary", + "secondary": "btn-outline-secondary", + "info": "btn-info", + "warning": "btn-warning", + "danger": "btn-danger", + "success": "btn-success" + }, + "actions_sticky_top": False +} diff --git a/server/core/config/local.py b/server/core/config/local.py new file mode 100644 index 0000000..cfee317 --- /dev/null +++ b/server/core/config/local.py @@ -0,0 +1,2 @@ +from .base import * + diff --git a/server/core/production.py b/server/core/config/production.py similarity index 92% rename from server/core/production.py rename to server/core/config/production.py index 17b4dab..0a0a318 100644 --- a/server/core/production.py +++ b/server/core/config/production.py @@ -1,6 +1,6 @@ -from .settings import * +from .base import * -DEBUG = False +DEBUG = bool(config('DJANGO_DEBUG', default=False)) ALLOWED_HOSTS = ['74.119.195.253', 'cms.2077.xyz'] diff --git a/server/core/config/tests.py b/server/core/config/tests.py new file mode 100644 index 0000000..cfee317 --- /dev/null +++ b/server/core/config/tests.py @@ -0,0 +1,2 @@ +from .base import * + diff --git a/server/core/media/firewall.png b/server/core/media/firewall.png new file mode 100644 index 0000000..0d3f12a Binary files /dev/null and b/server/core/media/firewall.png differ diff --git a/server/core/settings.py b/server/core/settings.py deleted file mode 100644 index 7c07cd4..0000000 --- a/server/core/settings.py +++ /dev/null @@ -1,371 +0,0 @@ -""" -Django settings for core project. - -Generated by 'django-admin startproject' using Django 5.0.7. - -For more information on this file, see -https://docs.djangoproject.com/en/5.0/topics/settings/ - -For the full list of settings and their values, see -https://docs.djangoproject.com/en/5.0/ref/settings/ -""" - -import os -from pathlib import Path - -from decouple import config - -# Build paths inside the project like this: BASE_DIR / 'subdir'. -BASE_DIR = Path(__file__).resolve().parent.parent - -# Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/ - -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = config('SECRET_KEY') - -# SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True - -ALLOWED_HOSTS = ['localhost', '127.0.0.1', '[::1]', '74.119.195.253', 'cms.2077.xyz'] - -# Application definition - -DJANGO_APPS = [ - 'jazzmin', - 'django.contrib.admin', - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.messages', - 'django.contrib.staticfiles', - 'rest_framework', -] - -LOCAL_APPS = [ - 'apps.common', - 'apps.research', -] - -THIRD_PARTY_APPS = [ - 'corsheaders', - 'ckeditor_uploader', - 'django_ckeditor_5', -] - -INSTALLED_APPS = DJANGO_APPS + LOCAL_APPS + THIRD_PARTY_APPS - -MIDDLEWARE = [ - 'django.middleware.security.SecurityMiddleware', - 'whitenoise.middleware.WhiteNoiseMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'corsheaders.middleware.CorsMiddleware', - 'django.middleware.common.CommonMiddleware', - 'django.middleware.csrf.CsrfViewMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.messages.middleware.MessageMiddleware', - 'django.middleware.clickjacking.XFrameOptionsMiddleware', -] - -REST_FRAMEWORK = { - 'DEFAULT_PERMISSION_CLASSES': [ - 'rest_framework.permissions.IsAuthenticatedOrReadOnly', - ], - "NON_FIELD_ERRORS_KEY": "error", - -} -# Possible Permissions to explore based on use case -# 'rest_framework.permissions.AllowAny', -# 'rest_framework.permissions.IsAuthenticated', -# 'rest_framework.permissions.IsAdminUser', -# 'rest_framework.permissions.IsAuthenticatedOrReadOnly', - -CORS_ALLOWED_ORIGINS = [ - "http://localhost:3000", - "http://127.0.0.1:8000", - "http://74.119.195.253:8000", - "http://cms.2077.xyz", - "https://cms.2077.xyz", -] - -CSRF_TRUSTED_ORIGINS = ['http://74.119.195.253', 'http://cms.2077.xyz', 'https://cms.2077.xyz'] - -ROOT_URLCONF = 'core.urls' - -# configured to serve static files -TEMPLATES = [ - { - 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [ - BASE_DIR / '../../client/build', - 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', - ], - }, - }, -] - -WSGI_APPLICATION = 'core.wsgi.application' - -# Database -# https://docs.djangoproject.com/en/5.0/ref/settings/#databases - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': BASE_DIR / 'db.sqlite3', - } -} - -# Password validation -# https://docs.djangoproject.com/en/5.0/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/5.0/topics/i18n/ - -LANGUAGE_CODE = 'en-us' - -TIME_ZONE = 'UTC' - -USE_I18N = True - -USE_TZ = True - -# Static files (CSS, JavaScript, Images) -# https://docs.djangoproject.com/en/5.0/howto/static-files/ - -STATIC_URL = 'staticfiles/' -STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') -MEDIA_URL = '/media/' - -MEDIA_ROOT = os.path.join(BASE_DIR, 'media') - -STATICFILES_DIRS = [ - '../client/build/static/', - os.path.join(BASE_DIR, 'static'), -] - -STORAGES = { - "default": { - "BACKEND": "django.core.files.storage.FileSystemStorage", - }, - "staticfiles": { - "BACKEND": "whitenoise.storage.CompressedStaticFilesStorage", - }, -} - -# Default primary key field type -# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field - -DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' - -JAZZMIN_SETTINGS = { - "site_brand": "2077 Collective Admin", - # title of the window (Will default to current_admin_site.site_title if absent or None) - "site_title": "2077 Collective Admin", - # Title on the login screen (19 chars max) (defaults to current_admin_site.site_header if absent or None) - "site_header": "2077 Collective", - # Logo to use for your site, must be present in static files, used for brand on top left - "site_logo": "../static/logo.png", - # Logo to use for your site, must be present in static files, used for login form logo (defaults to site_logo) - "login_logo": "../static/logo.png", - # CSS classes that are applied to the logo above - "site_logo_classes": "img-circle", - # Relative path to a favicon for your site, will default to site_logo if absent (ideally 32x32 px) - "site_icon": "../static/logo.png", - # Welcome text on the login screen - "welcome_sign": "Welcome to the 2077 Collective Admin Section", - # Copyright on the footer - "copyright": "2077 Collective Ltd", - # The model admin to search from the search bar, search bar omitted if excluded - "search_model": [], - # Field name on user model that contains avatar ImageField/URLField/Charfield or a callable that receives the user - # "user_avatar": "avatar", - - ############# - # User Menu # - ############# - # Additional links to include in the user menu on the top right ("app" url type is not allowed) - "usermenu_links": [{"name": "2077 Collective Platform"}, {"model": "core.user"}], - - ############# - # Side Menu # - ############# - # Whether to display the side menu - "show_sidebar": True, - # Whether to aut expand the menu - "navigation_expanded": True, - # Hide these apps when generating side menu e.g (auth) - "hide_apps": {"authtoken": ['tokenproxy'], "token_blacklist": ["blacklistedtoken", "outstandingtoken"]}, - # List of apps (and/or models) to base side menu ordering off of (does not need to contain all apps/models) - "order_with_respect_to": ["auth", "research"], - - "related_modal_active": False, - - "icons": { - "auth.group": "fas fa-users", - "auth.user": "fas fa-universal-access", - "research.article": "fas fa-newspaper", - "research.category": "fas fa-list", - }, - # Icons that are used when one is not manually specified - "default_icon_parents": "fas fa-chevron-circle-right", - "default_icon_children": "fas fa-circle", - - ############# - # UI Tweaks # - ############# - "changeform_format": "carousel", - # override change forms on a per modeladmin basis - "changeform_format_overrides": { - "auth.user": "collapsible", - "auth.group": "vertical_tabs", - }, -} - -JAZZMIN_UI_TWEAKS = { - "navbar_small_text": False, - "footer_small_text": False, - "body_small_text": False, - "brand_small_text": True, - "brand_colour": "navbar-teal", - "accent": "accent-navy", - "navbar": "navbar-teal navbar-dark", - "no_navbar_border": True, - "navbar_fixed": False, - "layout_boxed": False, - "footer_fixed": False, - "sidebar_fixed": False, - "sidebar": "sidebar-light-teal", - "sidebar_nav_small_text": False, - "sidebar_disable_expand": False, - "sidebar_nav_child_indent": False, - "sidebar_nav_compact_style": False, - "sidebar_nav_legacy_style": False, - "sidebar_nav_flat_style": False, - "theme": "yeti", - "dark_mode_theme": "darkly", - "button_classes": { - "primary": "btn-outline-primary", - "secondary": "btn-outline-secondary", - "info": "btn-info", - "warning": "btn-warning", - "danger": "btn-danger", - "success": "btn-success" - }, - "actions_sticky_top": False -} - -# CKEDITOR CONFIGS -CKEDITOR_UPLOAD_PATH = 'ckeditor_uploads/' - -CKEDITOR_IMAGE_BACKEND = "pillow" - -customColorPalette = [ - { - 'color': 'hsl(4, 90%, 58%)', - 'label': 'Red' - }, - { - 'color': 'hsl(340, 82%, 52%)', - 'label': 'Pink' - }, - { - 'color': 'hsl(291, 64%, 42%)', - 'label': 'Purple' - }, - { - 'color': 'hsl(262, 52%, 47%)', - 'label': 'Deep Purple' - }, - { - 'color': 'hsl(231, 48%, 48%)', - 'label': 'Indigo' - }, - { - 'color': 'hsl(207, 90%, 54%)', - 'label': 'Blue' - }, -] - -CKEDITOR_5_CONFIGS = { - 'default': { - 'toolbar': ['undo', 'redo', '|', 'heading', '|', 'bold', 'italic', 'underline', 'strikethrough', 'link', 'horizontalLine', '|', 'fontsize', - 'fontfamily', 'fontColor', 'fontBackgroundColor', '|', 'alignment', 'outdent', 'indent', - 'linespacing', '|', - 'bulletedList', 'numberedList', 'findAndReplace', 'highlight', 'subscript', 'superscript', - 'specialCharacters', '|', 'imageInsert', 'code', 'codeBlock', 'insertTable', 'mediaEmbed', '|', - 'blockQuote', 'fullscreen', 'removeFormat'], - - 'image': { - 'upload': { - 'path': 'ckeditor_uploads/', - }, - 'toolbar': ['imageTextAlternative', '|', 'imageStyle:alignLeft', - 'imageStyle:alignRight', 'imageStyle:alignCenter', 'imageStyle:side', 'imageResize', '|'], - 'styles': [ - 'full', - 'side', - 'alignLeft', - 'alignRight', - 'alignCenter', - ], - 'resize': { - 'enabled': False # Disable image resizing - } - }, - - 'blockToolbar': { - 'items': [ - 'paragraph', 'heading1', 'heading2', 'heading3', - '|', - 'bulletedList', 'numberedList', - '|', - 'blockQuote', - ], - 'location': 'left', # Position the block toolbar on the left - }, - 'plugins': { - 'imageInsert': { - 'enabled': True - } - } - }, - - 'extends': { - - }, - 'list': { - 'properties': { - 'styles': 'true', - 'startIndex': 'true', - 'reversed': 'true', - } - } -} - -SILENCED_SYSTEM_CHECKS = [ - "staticfiles.W004" -] diff --git a/server/core/wsgi.py b/server/core/wsgi.py index 53399e0..55b3b50 100644 --- a/server/core/wsgi.py +++ b/server/core/wsgi.py @@ -8,9 +8,12 @@ """ import os +from dotenv import load_dotenv + +load_dotenv() from django.core.wsgi import get_wsgi_application -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'core.settings') +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'core.config.local') application = get_wsgi_application() diff --git a/server/db.sqlite3 b/server/db.sqlite3 index 3b95060..d943d57 100644 Binary files a/server/db.sqlite3 and b/server/db.sqlite3 differ diff --git a/server/manage.py b/server/manage.py index f2a662c..06e9401 100755 --- a/server/manage.py +++ b/server/manage.py @@ -2,11 +2,13 @@ """Django's command-line utility for administrative tasks.""" import os import sys +from dotenv import load_dotenv - +load_dotenv() +print(os.environ.get('DJANGO_SETTINGS_MODULE')) def main(): """Run administrative tasks.""" - os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'core.settings') + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'core.config.local') try: from django.core.management import execute_from_command_line except ImportError as exc: diff --git a/server/requirements.txt b/server/requirements.txt index 9ccca9f..1782a32 100644 --- a/server/requirements.txt +++ b/server/requirements.txt @@ -23,6 +23,7 @@ jsonschema==4.23.0 jsonschema-specifications==2023.12.1 packaging==24.1 pillow==10.4.0 +psycopg2-binary==2.9.9 python-decouple==3.8 python-dotenv==1.0.1 PyYAML==6.0.1