I’ve organized my project as the following:
myproject/
urls.py
settings.py
views.py
templates/
apps/
__init__.py <-- needed in order to be identified as a package
exampleapp/
__init__.py
admin.py
models.py
urls.py
views.py
exampleapp2/
...
In my settings.py INSTALLED_APPS, the apps are name ‘apps.exampleapp1’, ‘apps.exampleapp2’ with the dot (.) notation indicating that the modules are in subdirectories. According to the documentation, if I wish to override or extend the admin templates for an app I need to make a directory in templates named ‘admin/appname/modelname/’ but I’ve tried both ‘admin/apps/exampleapp/’ and ‘admin/apps.exampleapp’ but neither work. Where in the django.contrib.admin code can I find how templates are replaced or, more simply, what directory path do I need to have in order to extend or replace an admin template?
How you organize your apps is inconsequential. The app’s name is still just its immediate foldername: “exampleapp” or “exampleapp2”.
So your admin template overrides should go in “/templates/admin/exampleapp/modelname/” and “/templates/admin/exampleapp2/modelname/”.