bittner / django-apptemplates

Django template loader that allows you to load and override a template from a specific Django application.
https://pypi.python.org/pypi/django-apptemplates
MIT License
51 stars 12 forks source link

Problems with AppConfig #12

Open benjaoming opened 6 years ago

benjaoming commented 6 years ago

It seems that if an application is specified via AppConfig, it will not work:

INSTALLED_APPS = (
    'wiki.apps.WikiConfig'
)

For django-wiki, this produces errors like TemplateDoesNotExist: "wiki:wiki/base.html". Other variations like specifying the app config {% extends "wiki.apps.WikiConfig:wiki/base.html" %} aren't working neither.

Specified as just the app, it works:

INSTALLED_APPS = (
    'wiki'
)

I kind of gather from the implementation that it's assumed that the entry of INSTALLED_APPS is importable models and not AppConfig class paths?

https://github.com/bittner/django-apptemplates/blob/master/apptemplates/__init__.py#L18

benjaoming commented 6 years ago

Just found out that this works fine with django-app-namespace-template-loader, and I'm good switching to that :)

bittner commented 6 years ago

Thanks for the hint!

The issue seems to be identical to https://github.com/Fantomas42/django-app-namespace-template-loader/issues/10.

benjaoming commented 6 years ago

You can see the fix in the diffset between 0.3 and 0.3.1 where it was fixed: https://github.com/Fantomas42/django-app-namespace-template-loader/compare/0.3...v0.3.1

bittner commented 6 years ago

Do you want to try a PR?

benjaoming commented 6 years ago

No, I switched to the other app -- remember https://github.com/Fantomas42/django-app-namespace-template-loader/pull/15 ? ;)

bittner commented 6 years ago

Just checking. Thanks for reporting, anyway.