#24809: Won't load templates from apps directory without a model
---------------------------------+------------------------
Reporter: camiloforero | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: 1.8
Severity: Normal | Keywords: app loader
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------
When creating a new app, the templates loader won't look at the
<appname>/templates directory if there are no models of it migrated to the
database, throwing a TemplateDoesNotExist exception and showing in the
postmortem that it only looked for them in the 'auth' and 'admin'
application template directories. The new app had already been added to
the 'INSTALLED_APPS' section of the settings.py file. Doing a
makemigrations and a migrate did nothing
This was fixed after I created a dummy class in <appname>/models.py, and
did a makemigrations->migrate. So my guess is that the template loader
relies somehow in the database, and if there is no reference to an app on
it then it won't look at it's templates directories despite it being on
the INSTALLED_APPS tuple. So I don't know if that's intended behaviour or
not, but here I call it to your attention.
--
Ticket URL: <https://code.djangoproject.com/ticket/24809>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/055.daf7f054ad88445d649da1b78885a0c8%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.