# Wrong app name in template path?

**URL:** <https://forum.djangoproject.com/t/wrong-app-name-in-template-path/31100>\
**Category:** Templates & Frontend\
**Created:** [May 13, 2024, 1:33am UTC](https://forum.djangoproject.com/t/wrong-app-name-in-template-path/31100 "2024-05-13T01:33:08Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![harryjsaddler](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/harryjsaddler/32/20601_2.png) [@harryjsaddler](https://forum.djangoproject.com/u/harryjsaddler)\
**Post date:** [May 13, 2024, 1:33am UTC](https://forum.djangoproject.com/t/wrong-app-name-in-template-path/31100/1 "2024-05-13T01:33:08Z")

</div>

My project has two apps, Catalog and Artwork.

In trying to resolve the url `http://127.0.0.1:8000/artwork/public/drawings/`, I get the error `TemplateDoesNotExist at /artwork/public/drawings/ (artwork/group.html) `.

The error page shows it’s trying to load `…akdb-env/akdb/catalog/templates/artwork/group.html` rather than `…akdb-env/akdb/artwork/templates/artwork/group.html`

The TEMPLATES setting is:

```auto
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',
                'catalog.context_processors.external_images_url',
           ],
        },
    },
]

```

And the INSTALLED\_APPS setting is:

```auto
INSTALLED_APPS = [
    'catalog.apps.CatalogConfig',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
]

```

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [May 13, 2024, 2:18am UTC](https://forum.djangoproject.com/t/wrong-app-name-in-template-path/31100/2 "2024-05-13T02:18:16Z")

</div>

Can you please clarify:

Describe the directory structure of your project.

What directory is the intended template in?

What does the `render` statement look like?

---

<div class="post-metadata">

**Author:** ![harryjsaddler](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/harryjsaddler/32/20601_2.png) [@harryjsaddler](https://forum.djangoproject.com/u/harryjsaddler)\
**Post date:** [May 13, 2024, 5:31am UTC](https://forum.djangoproject.com/t/wrong-app-name-in-template-path/31100/3 "2024-05-13T05:31:35Z")

</div>

Directory structure, starting from the project dir:

```auto
akdb
├── akdb
├──── urls.py
├── artwork
├──── templates
├────── artwork
├──────── group.html ← this is the target template
├──────── <some other templates>
├──── urls.py
├── catalog
├──── templates
├────── catalog
├──────── <some templates>
├──── urls.py

```

Render statement in artwork/views.py:

```auto
return render(request, "artwork/group.html", context)

```

So I don’t know where the artwork app is getting ‘catalog’ for the template path… but note that `artwork/views.py` does this import:

```auto
from catalog.models import Artwork, Group, Space

```

because the artwork app uses those same models as defined in the catalog app.

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [May 13, 2024, 5:46am UTC](https://forum.djangoproject.com/t/wrong-app-name-in-template-path/31100/4 "2024-05-13T05:46:26Z")

</div>

I don’t see where you have an `artwork` app listed in your `INSTALLED_APPS` setting. Is it there? (It’s searching your catalog app because it is listed.)

---

<div class="post-metadata">

**Author:** ![harryjsaddler](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/harryjsaddler/32/20601_2.png) [@harryjsaddler](https://forum.djangoproject.com/u/harryjsaddler)\
**Post date:** [May 13, 2024, 6:23am UTC](https://forum.djangoproject.com/t/wrong-app-name-in-template-path/31100/5 "2024-05-13T06:23:40Z")

</div>

I thought of that, but, if I add the artwork app to INSTALLED\_APPS, I get the error `django.contrib.admin.exceptions.AlreadyRegistered: The model Artwork is already registered in app 'catalog'.`

The artwork app works fine with this:

```auto
INSTALLED_APPS = [
    'catalog.apps.CatalogConfig',

```

but the catalog app fails with this:

```auto
INSTALLED_APPS = [
    'catalog.apps.CatalogConfig',
    'artwork.apps.ArtworkConfig',

```

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [May 13, 2024, 11:33am UTC](https://forum.djangoproject.com/t/wrong-app-name-in-template-path/31100/6 "2024-05-13T11:33:35Z")

</div>

What do your apps.py files look like? Also, please post the complete error message you are receiving, along with identifying when you are receiving it. (I think this error can also be caused by having the same model defined in two different `admin.py` files. Verify that this is not the case.)

---

<div class="post-metadata">

**Author:** ![harryjsaddler](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/harryjsaddler/32/20601_2.png) [@harryjsaddler](https://forum.djangoproject.com/u/harryjsaddler)\
**Post date:** [May 13, 2024, 4:18pm UTC](https://forum.djangoproject.com/t/wrong-app-name-in-template-path/31100/7 "2024-05-13T16:18:35Z")

</div>

They were identical… looks like that was the problem.

```auto
from django.contrib import admin
from catalog.models import Artwork, Group, Space, Status

admin.site.register(Artwork)
admin.site.register(Status)
admin.site.register(Group)
admin.site.register(Space)

```

Both apps use all the same models (so far); I removed them from the artwork admin.py and the error is gone. I’d guess that that file doesn’t even need to exist.

---

<div class="post-metadata">

**Author:** ![harryjsaddler](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/harryjsaddler/32/20601_2.png) [@harryjsaddler](https://forum.djangoproject.com/u/harryjsaddler)\
**Post date:** [May 13, 2024, 4:32pm UTC](https://forum.djangoproject.com/t/wrong-app-name-in-template-path/31100/8 "2024-05-13T16:32:54Z")

</div>

Sorry, that was the admin.py file(s), which seem to have been the problem. The apps.py files look right:

```auto
from django.apps import AppConfig

class CatalogConfig(AppConfig):
    default_auto_field = 'django.db.models.BigAutoField'
    name = 'catalog'

```

and

```auto
from django.apps import AppConfig

class ArtworkConfig(AppConfig):
    default_auto_field = 'django.db.models.BigAutoField'
    name = 'artwork'

```
