python django 重定向到当前视图函数

目前的问题是在验证成功后 return redirect(index) 报错
Reverse for 'views.login' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []

为了方便,下面是伪代码,在login.html验证通过之后,将用户名保存在session中,跳转到index函数进行处理。验证失败,则返回login.html

 views.py

 from django.shortcuts import render_to_response, redirect
 def login(request):
       if true:
            return redirect(index)
             else:
                  return login.html

def index(request):
       return index.html

我的django版本是1.10

刚刚忘了预览了。。。。,这是伪代码,不要纠结代码问题,怎么解决 return redirect(index)

参考:

 http://blog.csdn.net/ei__nino/article/details/8567698