0
2

More than 3 years have passed since last update.

djangoでTemplateDoesNotExist が出たら

Posted at

Djangoでwebサイト作りの練習をしていたところ上記のエラーが出た。
アプリ内のディレクトリのurls.py やviews.py ではimportができていたので困ってググったところ、プロジェクトのディレクトリ内のsettings.pyでの

django.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',
            ],
        },
    },
]

でDIRのtemplatesが間違えていてtemplateであった。単純なミスだがプロジェクトのsettings.pyにミスが起きることを確認した

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2