This behavior seems counter intuitive, and contrary to what the 
documentation says

For example: my settings.py file is as follows:

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]


According to this documentation, APP_DIR should behave as follows:

https://docs.djangoproject.com/en/2.2/howto/overriding-templates/#overriding-from-an-app-s-template-directory

> With APP_DIRS 
<https://docs.djangoproject.com/en/2.2/ref/settings/#std:setting-TEMPLATES-APP_DIRS>
 set 
to True, the template loader will look in the app’s templates directory and 
find the templates.

This isn't the behavior that is happening. djang_admin and mysite are 
technically separate apps, and have seperate template directories. 

On Sunday, November 10, 2019 at 3:49:32 PM UTC-5, Alexander Beach wrote:
>
> I am trying to create registration forms using Django's built in auth 
> forms.  However, when using the Django admin, the Django admin templates 
> are always being used.
>
> My application structure is as follows:
>
> ├── bug
> │   ├── __init__.py
> │   ├── __pycache__
> │   ├── settings.py
> │   ├── urls.py
> │   └── wsgi.py
> ├── db.sqlite3
> ├── manage.py
> └── mysite
>     ├── admin.py
>     ├── apps.py
>     ├── __init__.py
>     ├── migrations
>     │   └── __init__.py
>     ├── models.py
>     ├── registration
>     ├── templates
>     │   └── registration
>     │       └── password_reset_form.html
>     ├── tests.py
>     └── views.py
>
>
>
> My urls.py is the following:
>
>
> from django.contrib import admin
> from django.conf.urls import include, url
> from django.urls import path
>
>
> urlpatterns = [
>     path('admin/', admin.site.urls),
>     url(r'^accounts/', include('django.contrib.auth.urls'), name="auth"),
> ]
>
>
>
> The mysite/templates/registration/password_reset_form.html is not being 
> rendered.  When I navigate to localhost:8000/accounts/password_reset, i can 
> see that its using the Django Admin template. See attached screenshot.  I 
> am expecting my custom template for the reset form to be rendered.
>
> I am using Django version 2.2.5 and python 3.7.3
>
> Is this a bug or the expected behavior? I don't want to remove the admin 
> app. 
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0520c4c2-abbb-441c-bd81-1aeeb8c355b8%40googlegroups.com.

Reply via email to