Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion djangosnippets/settings/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
from pathlib import Path

import dj_database_url
from django.contrib import messages
Expand All @@ -13,6 +14,7 @@ def user_url(user):


PROJECT_ROOT = os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir)
BASE_DIR = Path(__file__).resolve().parent.parent.parent

SITE_ID = 1
SITE_NAME = "djangosnippets.org"
Expand Down Expand Up @@ -68,6 +70,7 @@ def user_url(user):
"theme",
"django_recaptcha",
"django_extensions",
"django_components",
"rest_framework",
"django_htmx",
)
Expand All @@ -92,7 +95,6 @@ def user_url(user):
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [os.path.join(PROJECT_ROOT, "templates")],
"APP_DIRS": True,
"OPTIONS": {
"context_processors": [
"django.contrib.auth.context_processors.auth",
Expand All @@ -102,13 +104,29 @@ def user_url(user):
"django.contrib.messages.context_processors.messages",
"django.template.context_processors.request",
],
"loaders": [(
"django.template.loaders.cached.Loader", [
"django.template.loaders.filesystem.Loader",
"django.template.loaders.app_directories.Loader",
"django_components.template_loader.Loader",
]
)],
'builtins': [
'django_components.templatetags.component_tags',
],
},
}
]

STATIC_URL = "/assets/static/"
STATIC_ROOT = os.path.join(PROJECT_ROOT, "..", "assets", "static")
STATICFILES_DIRS = (os.path.join(PROJECT_ROOT, "static"),)
STATICFILES_FINDERS = [
"django.contrib.staticfiles.finders.FileSystemFinder",
"django.contrib.staticfiles.finders.AppDirectoriesFinder",
"django_components.finders.ComponentsFileSystemFinder",
]

TAILWIND_APP_NAME = "theme"

SESSION_ENGINE = "django.contrib.sessions.backends.cached_db"
Expand Down
6 changes: 6 additions & 0 deletions djangosnippets/settings/development.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@
CACHE_BACKEND = "dummy://"

INSTALLED_APPS = INSTALLED_APPS

TEMPLATES[0]["OPTIONS"]["loaders"] = [
"django.template.loaders.filesystem.Loader",
"django.template.loaders.app_directories.Loader",
"django_components.template_loader.Loader",
]
1 change: 1 addition & 0 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ whitenoise==6.1.0
psycopg2-binary==2.9.10
djangorestframework==3.14.0
django-htmx==1.15.0
django_components==0.141.1
gevent==22.10.2 # Updated version of gevent
greenlet==3.0.3 # Updated version of greenlet
requests-oauthlib==1.3.1