【发布时间】:2017-05-26 17:05:49
【问题描述】:
我正在学习一个教程,并在这行代码中遇到了 TypeError:
c.update(csrf(request))
这是全图
from django.shortcuts import render
from django.views.decorators import csrf
def index(request):
c = {} #dictionary called c
c.update(csrf(request))
return render(request, 'login/index.html', c)
我是在做一些改变的旧版本吗?我是否错误地导入了 csrf?我正在运行最新版本的 Django。
【问题讨论】:
-
你得到的完整错误是什么?
标签: python django python-2.7 django-views csrf