Is it possible to re-load templates in Django?

I have written a custom template loader, and templates may change during the lifetime of a server. As I understand it, the first time a template is loaded it is parsed into the in-memory node-tree and thereafter it is cached.

Is it possible to invalidate this caching by issuing a command to say 'unload this template so it is re-loaded next time'? Or can my template loader take care of this?

Answers


This:

the first time a template is loaded it is parsed into the in-memory node-tree and thereafter it is cached

is not true. Templates are only cached if you ask them to be. There's a caching template loader that you can enable, but it's not enabled by default.

So, in answer to your question, if you're using a custom loader and you don't want them to be cached, don't put that functionality into your custom loader.


Need Your Help

Is this powershell script a good way to find the owner then change the owner

file loops powershell ownership

I wrote a Powershell v3 script to list all the files owned by a user on our file server. It ran for 3 hours before I stopped it. It has to go through 619,238 Files and 57,452 Folders (517 GB). What

preg_match get text

php regex preg-match-all

I have test.php and on test1.php i have this php code running