I am currently using Django 1.5 and cannot figure out how to render a simple html page. I read about class based views, but not sure if this is what I want to do.
I am trying to display a simple index.html page, but according to some examples I saw, I need to put this code in app / views.py:
def index(request):
template = loader.get_template("app/index.html")
return HttpResponse(template.render)
Is there a reason my index.html page should be related to the application related to my django project? It seems to me more appropriate for the index.html page to fit the overall project.
In more detail, using this code in the views.py file, what do I need to insert in my urls.py so that index.html is actually?
EDIT:
Django project structure:
webapp/
myapp/
__init__.py
models.py
tests.py
views.py
manage.py
project/
__init__.py
settings.py
templates/
index.html
urls.py
wsgi.py
source
share