M
M
Mike2017-04-01 04:04:47
Django
Mike, 2017-04-01 04:04:47

Why does Django use its own template to change the password?

I am using django-registration. I downloaded the templates from github and unpacked them into the registration folder. When I try to change the password, that is, I go to the link

<a href="{% url 'auth_password_change' %}">Password change</a><br>

then Django starts using its own template, and I need to use my own template, i.e. password_change_form.html
What should I do?
PS: Moved the templates folder to the root of the project and in settings.py 'DIRS': [os.path.join(BASE_DIR, 'templates')], now Django uses my template for changing the password and resetting the password. Not sure if this is correct, but it works.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2017-04-02
@google_online

Yes, you did everything right. Here is a typical reconciliation configuration:

TEMPLATES = [{
    'BACKEND': 'django.template.backends.django.DjangoTemplates',
    'DIRS': [
        # insert your TEMPLATE_DIRS here
        os.path.join(BASE_DIR, 'templates')
    ],
    # 'APP_DIRS': True,
    'OPTIONS': {
        'context_processors': [
            "django.template.context_processors.i18n",
            "django.template.context_processors.request",
            "django.template.context_processors.csrf",
            "django.template.context_processors.media",
            "django.contrib.auth.context_processors.auth",
            "django.contrib.messages.context_processors.messages",
        ],
        'loaders': [
            # insert your TEMPLATE_LOADERS here
            'django.template.loaders.filesystem.Loader',
            'django.template.loaders.app_directories.Loader',
            # 'django.template.loaders.eggs.Loader',
        ],
    },
}]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question