Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the namespace and app name for django auth urls?

I am using the Django built-in auth function.

path('account/', include('django.contrib.auth.urls')),

When I try to reference it using {% url 'password_reset' %} as seen in the Django code. I get an error. How do I reference it? There doesn't seem to be any namespace or app_name in the Django source. The answers on Stack Overflow are either outdated or require one to manually rebuild the URL one by one and reference it.


1 Answers

I found that after moving the authentication URL out of my app's urls.py, {% url 'password_reset' %} works, which means that the app_name inherits that of my app.

{% url 'app_name:password_reset' %} would have worked before I moved the authentication URL.


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!