Python Django忘记密码

Python Django忘记密码,python,django,passwords,Python,Django,Passwords,我遵循以下准则: 但当我运行时,我有一个错误: File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response 115. response = callback(request, *callback_args, **callback_kwargs) File "/usr/local/lib/python2.7/dist-pac

我遵循以下准则:

但当我运行时,我有一个错误:

File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
  115.                         response = callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/utils/decorators.py" in _wrapped_view
  91.                     response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/views.py" in password_reset
  161.             form.save(**opts)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/forms.py" in save
  260.             email = loader.render_to_string(email_template_name, c)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py" in render_to_string
  170.         t = get_template(template_name)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py" in get_template
  146.     template, origin = find_template(template_name)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py" in find_template
  135.             source, display_name = loader(name, dirs)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py" in __call__
  43.         return self.load_template(template_name, template_dirs)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py" in load_template
  49.             template = get_template_from_string(source, origin, template_name)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py" in get_template_from_string
  157.     return Template(source, origin, name)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in __init__
  125.         self.nodelist = compile_string(template_string, origin)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in compile_string
  153.     return parser.parse()
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in parse
  274.                     compiled_result = compile_func(self, token)
File "/usr/local/lib/python2.7/dist-packages/django/template/defaulttags.py" in autoescape
  498.     nodelist = parser.parse(('endautoescape',))
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in parse
  274.                     compiled_result = compile_func(self, token)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader_tags.py" in do_block
  190.     nodelist = parser.parse(('endblock',))
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in parse
  274.                     compiled_result = compile_func(self, token)
File "/usr/local/lib/python2.7/dist-packages/django/template/defaulttags.py" in url
  1286.                 kwargs[name] = parser.compile_filter(value)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in compile_filter
  353.         return FilterExpression(token, self)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in __init__
  570.                                       "from '%s'" % (token[upto:], token))

Exception Type: TemplateSyntaxError at /accounts/password/reset/
Exception Value: Could not parse the remainder: ',' from 'uid,'
Reverse for 'django.contrib.auth.views.password_reset_confirm' with arguments '()' and keyword arguments '{u'uidb36': u'1', u'token': u'3ho-bd57a871a2fe3a4987ef'}' not found.
如何修复此错误

编辑:

我将此更改为
{{protocol}://{{domain}{%url'django.contrib.auth.views.password\u reset\u confirm'uidb36=uid token=token%}
,但我有以下错误:

File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
  115.                         response = callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/utils/decorators.py" in _wrapped_view
  91.                     response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/views.py" in password_reset
  161.             form.save(**opts)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/forms.py" in save
  260.             email = loader.render_to_string(email_template_name, c)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py" in render_to_string
  170.         t = get_template(template_name)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py" in get_template
  146.     template, origin = find_template(template_name)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py" in find_template
  135.             source, display_name = loader(name, dirs)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py" in __call__
  43.         return self.load_template(template_name, template_dirs)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py" in load_template
  49.             template = get_template_from_string(source, origin, template_name)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py" in get_template_from_string
  157.     return Template(source, origin, name)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in __init__
  125.         self.nodelist = compile_string(template_string, origin)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in compile_string
  153.     return parser.parse()
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in parse
  274.                     compiled_result = compile_func(self, token)
File "/usr/local/lib/python2.7/dist-packages/django/template/defaulttags.py" in autoescape
  498.     nodelist = parser.parse(('endautoescape',))
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in parse
  274.                     compiled_result = compile_func(self, token)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader_tags.py" in do_block
  190.     nodelist = parser.parse(('endblock',))
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in parse
  274.                     compiled_result = compile_func(self, token)
File "/usr/local/lib/python2.7/dist-packages/django/template/defaulttags.py" in url
  1286.                 kwargs[name] = parser.compile_filter(value)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in compile_filter
  353.         return FilterExpression(token, self)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in __init__
  570.                                       "from '%s'" % (token[upto:], token))

Exception Type: TemplateSyntaxError at /accounts/password/reset/
Exception Value: Could not parse the remainder: ',' from 'uid,'
Reverse for 'django.contrib.auth.views.password_reset_confirm' with arguments '()' and keyword arguments '{u'uidb36': u'1', u'token': u'3ho-bd57a871a2fe3a4987ef'}' not found.

?删除模板中
uidb36=uid
token=token
之间的逗号。在Django 1.5中:

在Django 1.5中,url模板标记的行为将更改。。。新库还放弃了对逗号语法的支持,用于将参数分隔到url模板标记


删除模板中
uidb36=uid
token=token
之间的逗号。在Django 1.5中:

在Django 1.5中,url模板标记的行为将更改。。。新库还放弃了对逗号语法的支持,用于将参数分隔到url模板标记


如果遇到
,则“url”需要非空的第一个参数。Django 1.5中的语法已更改,请参阅文档。
只需将url模板标记的第一个参数view/function放在双引号中。

如果遇到
“url”需要非空的第一个参数。Django 1.5中的语法已更改,请参阅文档。
只需将url模板标记的第一个参数视图/函数用双引号引起来。

您有什么版本的Django?听起来好像是模板中
uidb36=uid
token=token
之间的逗号有问题我使用的是django 1.5 django的哪个版本?这听起来像是模板中
uidb36=uid
token=token
之间的逗号有问题。我从django 1.5I中删除了逗号,但出现了以下错误:
'url'需要非空的第一个参数。Django 1.5中的语法已更改,请参阅文档。
我该做什么?我删除了逗号,但导致了此错误:
“url”需要非空的第一个参数。Django 1.5中的语法已更改,请参阅文档。
我该怎么做?