From my thoughts, I Add it to INSTALLED_APPS & lt; Div class = "span8" id = "editor2" & gt; {{Selected_campaign.description | Sign-out: "safe"}} & lt; / Div & gt; line to create a template tag Step: Add Module object is not capable of calling using the following template tag:
projectname / controlpanel / templatetags / __init __. Py (empty file)
projectname / controlpanel / templatetags / md_to_html.py template from the Markdown Import MarketDown register. Template. Library () @ register.filter (name = 'to_html') def to_html (MD): Return Markdown (MD)
{'Campaign': Campaign} ,
campaign with a
return example of the model textfield.
& lt; Div class = "span8" id = "editor2" & gt; {{Selected_campaign.description | To_html}} & lt; / Div & gt;
'django < / P>
Use {% load markup%}
Update:
django.contrib.markup has been deprecated in Django 1.5. Here is a simple replacement for the Markdown Filter. Remove
'django.contrib.markup', to
INSTALLED_APPS
templatetags folder to your
app folder.
templatetags folder an empty file
__init __. Py
markup.py inside
templatetags with these codes: django.utils.safestring import mark_safe import markdown As mkdn register = template.Library () @ register.filter DR markdown (value, smode = none): return mark_safe (mkdn.markdown (value, safe_mode = 'escape')) < / Div>
No comments:
Post a Comment