mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-02-18 04:20:51 +03:00
Simplify TEMPLATES
settings with APP_DIRS=True
(#3488)
This commit is contained in:
parent
fcb26de733
commit
d0d6ebd892
|
@ -29,6 +29,9 @@ pre-commit run --show-diff-on-failure -a
|
||||||
# run the project's tests
|
# run the project's tests
|
||||||
pytest
|
pytest
|
||||||
|
|
||||||
|
# Make sure the check doesn't raise any warnings
|
||||||
|
python manage.py check --fail-level WARNING
|
||||||
|
|
||||||
if [ -f "package.json" ]
|
if [ -f "package.json" ]
|
||||||
then
|
then
|
||||||
npm install
|
npm install
|
||||||
|
|
|
@ -35,3 +35,6 @@ docker-compose -f local.yml run django python manage.py makemigrations --dry-run
|
||||||
|
|
||||||
# Test support for translations
|
# Test support for translations
|
||||||
docker-compose -f local.yml run django python manage.py makemessages --all
|
docker-compose -f local.yml run django python manage.py makemessages --all
|
||||||
|
|
||||||
|
# Make sure the check doesn't raise any warnings
|
||||||
|
docker-compose -f local.yml run django python manage.py check --fail-level WARNING
|
||||||
|
|
|
@ -182,15 +182,11 @@ TEMPLATES = [
|
||||||
{
|
{
|
||||||
# https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-TEMPLATES-BACKEND
|
# https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-TEMPLATES-BACKEND
|
||||||
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
||||||
# https://docs.djangoproject.com/en/dev/ref/settings/#template-dirs
|
# https://docs.djangoproject.com/en/dev/ref/settings/#dirs
|
||||||
"DIRS": [str(APPS_DIR / "templates")],
|
"DIRS": [str(APPS_DIR / "templates")],
|
||||||
|
# https://docs.djangoproject.com/en/dev/ref/settings/#app-dirs
|
||||||
|
"APP_DIRS": True,
|
||||||
"OPTIONS": {
|
"OPTIONS": {
|
||||||
# https://docs.djangoproject.com/en/dev/ref/settings/#template-loaders
|
|
||||||
# https://docs.djangoproject.com/en/dev/ref/templates/api/#loader-types
|
|
||||||
"loaders": [
|
|
||||||
"django.template.loaders.filesystem.Loader",
|
|
||||||
"django.template.loaders.app_directories.Loader",
|
|
||||||
],
|
|
||||||
# https://docs.djangoproject.com/en/dev/ref/settings/#template-context-processors
|
# https://docs.djangoproject.com/en/dev/ref/settings/#template-context-processors
|
||||||
"context_processors": [
|
"context_processors": [
|
||||||
"django.template.context_processors.debug",
|
"django.template.context_processors.debug",
|
||||||
|
|
|
@ -123,19 +123,6 @@ DEFAULT_FILE_STORAGE = "{{cookiecutter.project_slug}}.utils.storages.MediaRootGo
|
||||||
MEDIA_URL = f"https://storage.googleapis.com/{GS_BUCKET_NAME}/media/"
|
MEDIA_URL = f"https://storage.googleapis.com/{GS_BUCKET_NAME}/media/"
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
# TEMPLATES
|
|
||||||
# ------------------------------------------------------------------------------
|
|
||||||
# https://docs.djangoproject.com/en/dev/ref/settings/#templates
|
|
||||||
TEMPLATES[-1]["OPTIONS"]["loaders"] = [ # type: ignore[index] # noqa F405
|
|
||||||
(
|
|
||||||
"django.template.loaders.cached.Loader",
|
|
||||||
[
|
|
||||||
"django.template.loaders.filesystem.Loader",
|
|
||||||
"django.template.loaders.app_directories.Loader",
|
|
||||||
],
|
|
||||||
)
|
|
||||||
]
|
|
||||||
|
|
||||||
# EMAIL
|
# EMAIL
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# https://docs.djangoproject.com/en/dev/ref/settings/#default-from-email
|
# https://docs.djangoproject.com/en/dev/ref/settings/#default-from-email
|
||||||
|
|
|
@ -20,18 +20,6 @@ TEST_RUNNER = "django.test.runner.DiscoverRunner"
|
||||||
# https://docs.djangoproject.com/en/dev/ref/settings/#password-hashers
|
# https://docs.djangoproject.com/en/dev/ref/settings/#password-hashers
|
||||||
PASSWORD_HASHERS = ["django.contrib.auth.hashers.MD5PasswordHasher"]
|
PASSWORD_HASHERS = ["django.contrib.auth.hashers.MD5PasswordHasher"]
|
||||||
|
|
||||||
# TEMPLATES
|
|
||||||
# ------------------------------------------------------------------------------
|
|
||||||
TEMPLATES[-1]["OPTIONS"]["loaders"] = [ # type: ignore[index] # noqa F405
|
|
||||||
(
|
|
||||||
"django.template.loaders.cached.Loader",
|
|
||||||
[
|
|
||||||
"django.template.loaders.filesystem.Loader",
|
|
||||||
"django.template.loaders.app_directories.Loader",
|
|
||||||
],
|
|
||||||
)
|
|
||||||
]
|
|
||||||
|
|
||||||
# EMAIL
|
# EMAIL
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# https://docs.djangoproject.com/en/dev/ref/settings/#email-backend
|
# https://docs.djangoproject.com/en/dev/ref/settings/#email-backend
|
||||||
|
|
Loading…
Reference in New Issue
Block a user