How to print html in python the normal way
Joel Goldstick
joel.goldstick at gmail.com
Thu Oct 4 09:19:35 EDT 2012
On Thu, Oct 4, 2012 at 9:11 AM, Ramchandra Apte <maniandram01 at gmail.com> wrote:
> On Thursday, 4 October 2012 17:00:57 UTC+5:30, Chris Angelico wrote:
>> On Thu, Oct 4, 2012 at 9:24 PM, <ashishjain.ash at gmail.com> wrote:
>>
>> > am I missing something.
>>
>>
You should look at the built in django tags, and learn about them
before writing your own
In this case, look here:
https://docs.djangoproject.com/en/dev/topics/templates/#filters
striptags
Strips all [X]HTML tags. For example:
{{ value|striptags }}
If value is "<b>Joel</b> <button>is</button> a <span>slug</span>",
the output will be "Joel is a slug".
Again, these are just a few examples; see the built-in filter
reference for the complete list.
--
Joel Goldstick
More information about the Python-list
mailing list