Reputation: 1822
I have the following in the templates/index.html
<!DOCTYPE html>
<html>
<head>
<title>Rango</title>
</head>
<body>
<h1>Rango says...</h1>
hello world! <strong>foo</strong><br />
<a href="/rango/about/">About</a><br />
</body>
How ever, the output is the following (page source)
<Text Node: '<!DOCTYPE html>
<html>
'>
What could be the reason?
EDIT:
Here is my view code:
from django.shortcuts import render
from django.http import HttpResponse
from django.template import RequestContext, loader
# Create your views here.
def index(request):
template = loader.get_template('index.html')
return HttpResponse(template)
Upvotes: 0
Views: 68
Reputation: 1219
You need to render the template in the view. Try the render_to_response shortcut. Otherwise show us the view code.
Upvotes: 1