NameError at /
name 'request' is not defined
Request Method: GET
Request URL: http://127.0.0.1:8000/
Django Version: 1.8
Exception Type: NameError
Exception Value:
name 'request' is not defined
Exception Location: ~/DjangoStudy/blog/views.py in post_list, line 4
from django.shortcuts import render
def post_list(requst):
return render(request, 'blog/post_list.html', {})
# Create your views here.
答案 0 :(得分:2)
您的观点中有一个拼写错误。
应该是
def post_list(request):
而不是
def post_list(requst): # it should be 'request' here and not 'requst'