I am not able to render any html pages in Django 1.7. My 'index.html' is in 'project/seatalloc/templates/index.html
' and my view.py in project/seatalloc/views.py
looks like:
def index(request):
return render(request, 'index.html', dirs=('templates',))
project/project/settings.py has templates dirs set:
TEMPLATE_DIRS = (
'/Users/Palak/Desktop/academics/sem3/cs251/lab11/project/seatalloc/templates',
)
urls.py:
urlpatterns = patterns('',
url(r'^seatalloc/', include('seatalloc.urls')),
url(r'^admin/', include(admin.site.urls)),
)
I have tried to follow the documentation strictly, yet can't figure out if Django detects the file, why am I getting TemplateDoesNotExist at /seatalloc/ error. I am new to Django, could someone please help.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…