Fix settings for templates & static files
This commit is contained in:
parent
e20d8cb1d5
commit
928bd06e3d
1 changed files with 10 additions and 1 deletions
|
@ -94,6 +94,7 @@ INSTALLED_APPS = [
|
|||
"django.contrib.messages",
|
||||
"django.contrib.staticfiles",
|
||||
"servala.core",
|
||||
"servala.frontend",
|
||||
]
|
||||
|
||||
MIDDLEWARE = [
|
||||
|
@ -117,12 +118,19 @@ STATICFILES_FINDERS = (
|
|||
"django.contrib.staticfiles.finders.FileSystemFinder",
|
||||
"django.contrib.staticfiles.finders.AppDirectoriesFinder",
|
||||
)
|
||||
STATICFILES_DIRS = [BASE_DIR / "servala" / "static"]
|
||||
template_loaders = (
|
||||
"django.template.loaders.filesystem.Loader",
|
||||
"django.template.loaders.app_directories.Loader",
|
||||
)
|
||||
if not DEBUG:
|
||||
template_loaders = (("django.template.loaders.cached.Loader", template_loaders),)
|
||||
|
||||
TEMPLATES = [
|
||||
{
|
||||
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
||||
"DIRS": [],
|
||||
"APP_DIRS": True,
|
||||
"APP_DIRS": False,
|
||||
"OPTIONS": {
|
||||
"context_processors": [
|
||||
"django.template.context_processors.request",
|
||||
|
@ -130,6 +138,7 @@ TEMPLATES = [
|
|||
"django.contrib.messages.context_processors.messages",
|
||||
"django.template.context_processors.static",
|
||||
],
|
||||
"loaders": template_loaders,
|
||||
},
|
||||
},
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue