django-postman と django-messages をインストールした後、TemplateNotFound が表示されます。私は明らかにそれらを別々にインストールしました-最初にdjango-postman、次にdjango-messages。これはとても簡単ですが、これを解決するために何時間も費やしました。
私は Django 1.8 を使用しています。これは、pip を使用した新しいベース インストールです。次に、上記の2つのパッケージをインストールしました。私の settings.py ファイルの TEMPLATES 部分は次のとおりです。
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [
os.path.join(BASE_DIR, 'templates'),
#os.path.join(BASE_DIR, 'templates/django_messages'),
],
'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',
],
},
},
]
INSTALLED_APPS タプル内に、上記のパッケージもインストールしました。
これがurls.pyへの私の追加です:
url(r'^messages/', include('django_messages.urls')),
システムに他の変更は加えられていませんが、/messages に移動すると、次のエラー メッセージが表示されます。
TemplateDoesNotExist at /messages/inbox/
django_messages/inbox.html
Request Method: GET
Request URL: http://localhost:8000/messages/inbox/
Django Version: 1.8.3
Exception Type: TemplateDoesNotExist
Exception Value:
django_messages/inbox.html
Exception Location: /projects/.virtualenvs/blatter/lib/python2.7/site-packages/django/template/loader.py in render_to_string, line 138
Python Executable: /projects/.virtualenvs/blatter/bin/python
Python Version: 2.7.6