Joseph Victor Zammit
Joseph Victor Zammit

Reputation: 15320

Does Django pick template changes when DEBUG=False? Yes, but HOW?

Yes it does! I just tested within an Nginx/gunicorn setup. Sub-questions:

  1. How does it notice the change in the template(s)?
  2. Does performance suffer in any way because of this "feature"?
  3. Can this "feature" be disabled/re-enabled?

Upvotes: 1

Views: 212

Answers (1)

computmaxer
computmaxer

Reputation: 1713

Django does not cache the loading of templates by default. Because they are not cached, they get loaded from disk every time they are rendered and that is why you'll see template changes without reloading the application.

If you're interested in caching the template loading process to improve performance (it will help a lot if you are rendering a number of different templates per request), take a look at this post.

Upvotes: 2

Related Questions