Hi!

You've found the wrong mailing list for this post. This mailing list is for
discussing the development of Django itself, not for support using Django.
This means the discussions of bugs and features in Django itself, rather
than in your code using it. People on this list are unlikely to answer your
support query with their limited time and energy.

For support, please follow the "Getting Help" page:
https://docs.djangoproject.com/en/stable/faq/help/ . This will help you
find people who are willing to support you, and to ask your question in a
way that makes it easy for them to answer.

That said, in response to your question: Django's default admin setup does
not come with a password reset view. It only has a "change password" view
for logged in users. If you want to support not-logged-in users to reset
their passwords, you need to add a URL as you have done.

Thanks,

Adam

On Sun, Jul 23, 2023 at 2:40 PM Marty <vpjtqwv0...@gmail.com> wrote:

> Hi,
>
> this is native django 4.2 code:
>
> *admin/login.html*
>
> ...
>
> <form action="{{ app_path }}" method="post" id="login-form">{% csrf_token
> %}
>
>   ...
>
>   {% url '*admin_password_reset*' as password_reset_url %}
>
>   {% if password_reset_url %}
>
>   <div class="password-reset-link">
>
>     <a href="{{ password_reset_url }}">{% translate 'Forgotten your
> password or username?' %}</a>
>
>   </div>
>
>   {% endif %}
>
>   ...
>
> </form>
>
> ...
>
>
>
> *auth/urls.py:*
>
> urlpatterns = [
>
>     ...
>
>     path("password_reset/", views.PasswordResetView.as_view
> <http://views.passwordresetview.as_view/>(), name="*password_reset*"),
>
>     ...
>
> ]
>
> In template is expected *admin_password_reset *but auth module generates
> *password_reset*.
> This is my project urls.py:
> urlpatterns = []
>
> if settings.DEBUG:
>     urlpatterns += [
>         path('__debug__/', include(debug_toolbar.urls)),
>         *static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT),
>     ]
>
> urlpatterns += [
>     # API
>     # path('api/ ', include('apps.management.api_urls')),
>
>     # extra pages
>     path('changelog/', management_views.changelog, name='changelog'),
>
>     # (due to password reset)
>     path('accounts/', include('django.contrib.auth.urls')),
>     *path('accounts/password_reset/', PasswordResetView.as_view(),
> name='admin_password_reset'),*
>
>     # modules
>     path('authentication/', include('apps.authentication.urls')),
>     path('management/', include('apps.management.urls')),
>
>     # native admin URLs
>     path('', admin.site.urls),  # must be last if admin URL is empty!
> ]
>
> Notice that I had to add the extra
>
> *path('accounts/password_reset/', PasswordResetView.as_view(),
> name='admin_password_reset'),*to display the reset password link. Is this
> on purpose in django or is this bug that should be fixed?
>
>
> Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/24afc193-c22a-4be8-9f3b-14315b2b7a8bn%40googlegroups.com
> <https://groups.google.com/d/msgid/django-developers/24afc193-c22a-4be8-9f3b-14315b2b7a8bn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMyDDM3Jj87WR6xuKnfVwA_j%3Do0iGmVZLotYx0O5_311gaZRNQ%40mail.gmail.com.
  • Pas... Marty
    • ... 'Adam Johnson' via Django developers (Contributions to Django itself)

Reply via email to