django-fluent / django-fluent-comments

A modern, ajax-based appearance for django comments
https://django-fluent.org/
Apache License 2.0
182 stars 90 forks source link

Use Context() object as comment context #100

Closed black3r closed 7 years ago

black3r commented 7 years ago

This way we can use context processors in our overridden comment templates as expected.

codecov[bot] commented 7 years ago

Codecov Report

Merging #100 into master will increase coverage by 0.02%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #100      +/-   ##
==========================================
+ Coverage   85.03%   85.05%   +0.02%     
==========================================
  Files          16       16              
  Lines         608      609       +1     
==========================================
+ Hits          517      518       +1     
  Misses         91       91
Impacted Files Coverage Δ
fluent_comments/utils.py 96.55% <100%> (+0.12%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ef455b2...476f177. Read the comment docs.

vdboor commented 7 years ago

You hit a good point, however the solution isn't going to work on Django 1.11. As of Django 1.11, the template context should always be a dict, making it agnostic to the chosen template engine.

Instead, passing the request to the render_to_string() will invoke the Context object and context processors in the Django template engine.