Django render template from media folder

I'm trying to provide additional level of flexibility for some views, specifically, I want to be able to render a view using a django template from the media location (say referred to by a FileField, but it shouldn't matter).

What's the best way to approach this situation?

Answers


Add that directory to TEMPLATE_DIRS setting, and then use appropriate template name or path in view.

Templates in django can reside anywhere on filesystem.


Need Your Help

how many ways to reduce the number of TIME_WAIT as soon as possible in client

linux sockets client time-wait

If we must connect the db (redis)every time we need to write to or read from the db .After some operates then close the connection . Because the connect is frequently (assume the case must connec...

Converting string MM/DD/YYYY to NSDate

iphone objective-c ios nsdate

In my app i'm using Facebook Graph API and when I'm fetching user details i get the user's birthday as a string with format MM/DD/YYYY.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.