djedi-cms icon indicating copy to clipboard operation
djedi-cms copied to clipboard

Proof of concept: Support for Django cached template loader.

Open kjagiello opened this issue 11 years ago • 2 comments

In the current version, Djedi is completely useless when using the Django cached template loader. The reason is that Djedi currently relies on the nodes being instantiated on each request. When using the cached loader the nodes are instantiated only on the first template load and being cached until the template cache is cleared. When using cached loaders, it's neither possible to edit nodes using the editor nor will they reflect language changes.

This patch provides a new template loader, DjediCachedLoader, that can be used as a drop-in replacement for the builtin Django cached template loader. It solves the described problem by refreshing each Djedi node on every template load.

To-do:

  • [ ] Figure an elegant way to run tests using different template loaders
  • [ ] Move the template loaders to a better place
  • [ ] The lazy_tag decorator is no longer needed. We should probably deprecate it.
  • [ ] Document the new cached loader.

kjagiello avatar Aug 06 '14 11:08 kjagiello

Coverage Status

Coverage remained the same when pulling 36d0d9d630d4c8f7854eaf79965e8b2d1f384b7f on kjagiello:cached-loader into e73bf0c2a8c04dd39fe1fd7dda60f69499efb683 on 5monkeys:master.

coveralls avatar Aug 06 '14 11:08 coveralls

This looks very promising @kjagiello! Will do some testing and benchmarking.

lundberg avatar Aug 13 '14 12:08 lundberg