Answer the question
In order to leave comments, you need to log in
How to pass template name to url template so that it is not ignored?
Good afternoon, there is such a typical urlpatterns, in which I explicitly set which template to use:
url(r'^password_reset/$',
auth_views.PasswordResetView.as_view(template_name='project_name/registration/password_reset_form.html'),
{'post_reset_redirect': 'password_reset/done/'}, name="password_reset"),
Answer the question
In order to leave comments, you need to log in
Give more information. Perhaps the problem is in the template, namely in extends. Or the problem is in specifying the paths to statics and media.
Why use a standard view at all? For me, it's better to use a separate view in views:
from django.contrib.auth.models import User
def password_reset(request):
u = User.objects.get(username='john')
u.set_password('new password')
u.save()
#return формируете интересующую форму
urlpatterns = [
url(r'^password_reset/$', views.password_reset, name='password_reset'),
]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question