D
D
dzenn2016-03-20 22:27:04
Django
dzenn, 2016-03-20 22:27:04

Why is the template not showing up?

from django.shortcuts import render
from django.http import HttpResponse


def index(request):
    return HttpResponse(request, 'phylosophy/index.html', {})

Path to htmk document phylosophy/templates/phylosophy/index.html

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
kvkirill, 2016-03-20
@dzenn

1) Fix:

from django.shortcuts import render

def index(request):
    return render(request, 'phylosophy/index.html', {})

2) What's in urls.py?

S
sim3x, 2016-03-20
@sim3x

https://docs.djangoproject.com/en/1.9/ref/request-... is not for template rendering
use https://docs.djangoproject.com/en/1.9/topics/http/...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question