Path to the templates for /accounts/login, etc.


I am (still) a beginner in django. I am trying to use the default django user management for the user registration/login/logout/password reset functionalities.

I have added django.contrib.auth.urls to the urlpatterns, so that I could use for example

However, I am not clear on where to modify the templates for the registration/login/logout pages.

As I wasn’t able to find an answer in the documentation, I read the tutorial Django Tutorial Part 8: User authentication and permissions - Learn web development | MDN, where it mentioned that the template for the login page (accounts/login) can be stored in app/templates/registration/login.html. It works well. However, when I tried to follow the tutorial for the other templates, for example, logged_out.html, password_reset_form.html, nothing was changed and the website still uses the default django admin templates.

Could you please suggest the correct way to use the templates?

Thanks in advance!

Please be specific and show all the file names (and directories) for those templates along with any file contents created or modified for this.

Thanks for your reply!
I basically followed the tutorial, and created the following templates:

For example, logged_out.html simply contains the following:

{% extends "base_generic.html" %}

{% block content %}
  <p>Logged out!</p>
  <a href="{% url 'login'%}">Click here to login again.</a>
{% endblock %}

The problem is that it seems like this template is not used when I access Still, it shows the default Django administration log out page.

I am not sure, but maybe I should add something in, to explicitly write “template_name=‘…’”, for example:

urlpatterns = [

There isn’t anything you need to do with the urls.

Please show your TEMPLATES and INSTALLED_APPS settings in your file.

Also, is this templates directory listing you’re showing in your project directory or in an app directory?

Hi Ken,
thanks so much for your reply! Here are the settings:

        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [


If it’s in a project level directory, then that directory needs to be identified in the DIRS section of your TEMPLATES settings.

If it’s in an app directory, your app needs to be listed before the django apps in INSTALLED_APPS, because the template directories are searched in the order that they are listed.

Thanks so much for your help!

May I ask how to acknowledge you in a publication that might be published in several months?

The thought is appreciated but not necessary. If you like, you can acknowledge the general Django community or this forum collectively.

I see, thanks so much!