[Django]-How to avoid hardcoded template name in a django app, integrated with django-cms?

5๐Ÿ‘

โœ…

If your apphook is a single view mounted on /, you can just use {% extends request.current_page.get_template %}, however this does not work on subpages in your app.

For that you would need to reverse the root view of your app, use cms.utils.page_resolver.get_page_from_request with the use_path argument to get the page, then call get_template on the page and extend that.

๐Ÿ‘คojii

Leave a comment