[점프 투 장고] 2-04 템플릿 디렉토리

파일 : setting.py

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [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',
            ],
        },
    },
]

Imgur

jinhaesik 366

M 2021년 11월 7일 10:40 오전

목록으로
2개의 답변이 있습니다. 1 / 1 Page

장고 버전을 확인해 보셔야 할 것 같습니다.

settings.py 제일 상단에 BASE_DIR이 다음과 같이 정의되어 있어야 합니다.

from pathlib import Path

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent

박응용

2021년 11월 7일 11:50 오전

네 해결되었습니다.
감사합니다.

jinhaesik

2021년 11월 7일 12:46 오후