making TemplateView.template_name point to a file NOT in the templates directory.

49 views
Skip to first unread message

Sharif Mehedi

unread,
May 20, 2021, 1:42:04 PM5/20/21
to Django developers (Contributions to Django itself)
I do not have a django-admin project and using django views (along with other django submodules) in my python app, so, i do not have a directory structure like django projects has and I never had a templates directory in my app. The way we configured it, serving from templates directory is out of the question.

I want to know, if there's an easy solution in making django take a template_name as (django.views.generic.base).TemplateView.template_name that is (simply said) outside the templates directory.

TIA
Regards,
Sharif

Adam Johnson

unread,
May 21, 2021, 6:51:19 AM5/21/21
to django-d...@googlegroups.com
Hi!

I think you've found the wrong mailing list for this post. This mailing list is for discussing the development of Django itself, not for support using Django. This means the discussions of bugs and features in Django itself, rather than in your code using it. People on this list are unlikely to answer your support query with their limited time and energy.

For support, please follow the "Getting Help" page: https://docs.djangoproject.com/en/3.1/faq/help/ . This will help you find people who are willing to support you, and to ask your question in a way that makes it easy for them to answer.

I think perhaps you are looking for the DIRS key in the TEMPLATES setting, but a clearer question in one of the help channels would clarify your requirements.

Thanks for your understanding and all the best,

Adam

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/082f893b-5f32-4641-a786-7b1dff51ce4an%40googlegroups.com.

Sharif Mehedi

unread,
May 21, 2021, 12:07:43 PM5/21/21
to django-d...@googlegroups.com
Hi Adam,

Thank you for taking your time to reply on this. I thought that this problem was really too complicated. And at the time of desperation thought that it was a good idea to ask it in here since people here are more experienced with django internals, even though I knew it was the wrong place. Excuse me if I have over reached. A little later posting this mail I found out about the TEMPLATES DIRS key and immediately regretted posting in here, although decided against using the DIRS key.

But I am glad that you've answered so politely.
Thank you,
Sharif
Reply all
Reply to author
Forward
0 new messages