django-apptemplates icon indicating copy to clipboard operation
django-apptemplates copied to clipboard

Problems with AppConfig

Open benjaoming opened this issue 7 years ago • 6 comments

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 avatar Feb 25 '18 16:02 benjaoming

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

benjaoming avatar Feb 25 '18 16:02 benjaoming

Thanks for the hint!

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

bittner avatar Feb 26 '18 00:02 bittner

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

benjaoming avatar Feb 26 '18 09:02 benjaoming

Do you want to try a PR?

bittner avatar Mar 01 '18 22:03 bittner

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

benjaoming avatar Mar 01 '18 22:03 benjaoming

Just checking. Thanks for reporting, anyway.

bittner avatar Mar 02 '18 10:03 bittner