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.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
Hi,
I just tried to reproduce your issue using the following app structure:
{{{
bug24809/
├── __init__.py
└── templates
└── foo.html
}}}
After I added the app to `settings.INSTALLED_APPS`, I tried
`django.template.loader.get_template('foo.html')` and it did return a
template object (no `TemplateDoesNotExist` exception).
Do you have more information on how to reproduce your issue?
Thanks.
--
Ticket URL: <https://code.djangoproject.com/ticket/24809#comment:1>
* status: new => closed
* resolution: => needsinfo
Comment:
Given the amount of work that was put in Django 1.7 to make sure models.py
is optional, I'm pretty sure this isn't a behavior you'll see with vanilla
Django. The template layer is also decoupled from the model layer, so
there's no reason they would interact like this. Something else must be
going on in your project.
--
Ticket URL: <https://code.djangoproject.com/ticket/24809#comment:2>
Comment (by camiloforero):
I just tried to reproduce the issue but this time it worked as normal,
with no models. The error must have been somewhere else. Thank you
--
Ticket URL: <https://code.djangoproject.com/ticket/24809#comment:3>
* resolution: needsinfo => invalid
--
Ticket URL: <https://code.djangoproject.com/ticket/24809#comment:4>