title: Name Error Django
body: <p>I get a Name error while trying to run my project,</p>
  
  <p>urls.py</p>
  
  <pre><code>import os
  from django.conf.urls.defaults import patterns, include, url
  #from bookmarks.views import *
  from django.views.generic.simple import direct_to_template
  from preview.views import *
  # Uncomment the next two lines to enable the admin:
  # from django.contrib import admin
  # admin.autodiscover()
  
  urlpatterns = patterns('',
  
      (r'^catalog/$', home),
  )
  </code></pre>
  
  <p>views.py</p>
  
  <pre><code># Create your views here.
  from django.shortcuts import render_to_response
  
  def home(request):
      return render_to_response("index.html")
  </code></pre>
  
  <p>index.html</p>
  
  <pre><code>{% extends base.html %}
  {% block content %}
      &lt;h2&gt;Welcome!&lt;/h2&gt;
  {% endblock %}
  </code></pre>
  
  <p>settings.py</p>
  
  <pre><code>TEMPLATE_DIRS = (
      "C:/python27/Djangoprojects/ecomstore/preview",
      # 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.
  )
  </code></pre>
  
  <p>Error</p>
  
  <pre><code>NameError at /catalog/
  name 'home' is not defined
  Request Method: GET
  Request URL:    http://127.0.0.1:8000/catalog/
  Django Version: 1.3.1
  Exception Type: NameError
  Exception Value:    
  name 'home' is not defined
  Exception Location: C:\Python27\Djangoprojects\ecomstore\..\ecomstore\urls.py in &lt;module&gt;, line 12
  Python Executable:  C:\Python27\python.exe
  Python Version: 2.7.2
  </code></pre>