我收到此错误:
NameError at /storefront/
name 'storefront' is not defined
My Urls.Py看起来像这样:
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.views.generic import TemplateView
from accounts.views import home
from django.contrib import admin
urlpatterns = patterns('',
url(r"^$", home),
url(r"^storefront/", storefront, name="storefront")
My Views.Py看起来像这样:
def storefront(request):
latest_entries = Entry.objects.filter()
context = {'latest_entries': latest_entries}
return render(request, 'storefront.html', context)
网址或视图中的错误是什么?