Forums

I am having trouble implementing templates

I have a template in: /mysite/templates, index.html.

here is my views.py

from django.shortcuts import render_to_response

def foo(request):
     return render_to_response('index.html', {"foo": "bar"})

and here is my settings.py

TEMPLATE_DIRS = (
'/home/mickpc/mysite/templates',
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.

)

I have an index.html and its in templates.

Thank you MC

Have you wired up the view function to a URL in urls.py?

solved