You should have the email_form.jade file inside /templates/contact. Or place it in /templates/pages and change the line to template_name = "pages/email_form.jade".
Error: Template Does Not Exist
Domanda
I have two apps in one project the main apps call pages contain Home and About page the second apps is contact page. Here is my contact/urls.py in contact apps:
from .views import ContactFormView
urlpatterns = patterns('',
# URL pattern for the ContactView
url(regex=r'^contact/$', view=ContactFormView.as_view(), name='contact'),
)
the main apps pages/urls.py :
from django.conf.urls import patterns, url
from .views import AboutPageView, HomePageView
urlpatterns = patterns('',
url(regex=r'^$', view=HomePageView.as_view(), name='home'),
url(regex=r'^about/$', view=AboutPageView.as_view(), name='about'),
)
in main apps pages/views.py :
from vanilla import TemplateView
class HomePageView(TemplateView):
template_name = "pages/home.jade"
class AboutPageView(TemplateView):
template_name = "pages/about.jade"
class ContactFormView(TemplateView):
template_name = "contact/email_form.jade"
I get this error say django.template.base.TemplateDoesNotExist
TemplateDoesNotExist: /contact/email_form.jade
I am not sure why, the setting file is OK I can open the main page with the contact page in the menu nav when I click contact I get the error above. Any helps appreciate Thanks
Soluzione
Altri suggerimenti
Check to make sure you don't have the any of the parent directories the template is in marked as static
in app.yaml
.
App Engine stores and serves static files separately from application files. Static files are not available in the application's file system.
If you do either find a separate directory to place static files or you can optionally use
application_readable: True
in the configuration block for static files which allows the filesystem to read them.