Reverse for 'prev_url' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried:

出现的错误:
NoReverseMatch at /cart/add_cart/
Reverse for 'prev_url' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []
Request Method: GET
Request URL: http://127.0.0.1:8000/cart/add_cart/?id=207
Django Version: 1.8.2
Exception Type: NoReverseMatch
Exception Value:
Reverse for 'prev_url' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []
Exception Location: C:\Users\as\AppData\Local\Programs\Python\Python38\lib\site-packages\django\core\urlresolvers.py in _reverse_with_prefix, line 494
Python Executable: C:\Users\as\AppData\Local\Programs\Python\Python38\python.exe

我的代码:
view.py :
prev_url=request.META['HTTP_REFERER']
response=redirect('prev_url')

urls.py :
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^index/$', index),
url(r'^detail/$', detail),
url(r'^cart/add_cart/$', add_cart),

urlresolvers.py 第494行 :

img

img

img

你视图函数这个跳转有问题