Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'example:': 0.03; 'output': 0.04; 'subject:How': 0.09; 'cc:addr:python-list': 0.10; 'django': 0.10; 'subject:python': 0.11; 'oct': 0.16; 'tags.': 0.16; 'url:djangoproject': 0.16; 'wrote:': 0.17; 'thu,': 0.17; 'url:dev': 0.17; 'received:74.125.82.174': 0.23; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header :In-Reply-To:1': 0.25; 'am,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'chris': 0.28; 'case,': 0.29; 'thursday,': 0.30; 'received:74.125.82': 0.33; 'received:google.com': 0.34; 'built- in': 0.35; 'filter': 0.35; 'pm,': 0.35; 'list.': 0.35; 'received:74.125': 0.36; 'should': 0.36; 'october': 0.37; 'subject:: ': 0.38; 'url:docs': 0.38; 'url:en': 0.38; 'header:Received:5': 0.40; 'your': 0.60; 'here:': 0.62; 'tags,': 0.81; 'joel': 0.91; 'url:templates': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=eWQIc1KtQFqsBkH+3U7mw/KLm8+IguMy5fWF2EMu7oc=; b=ajbGrYkf2VypKdn885LJRilIwoL9NzOBZzOFFRJa2nYyMwP/ZJQHijnZ2yuM4gfAnD r2E198KvgPNqHw8c0ASLqZ1S/78Z+YMZtiNJS8l0bj9z8JlFZcWkeRHoTL/bBiwXgVdS fvr4g2/0NvcwCWy2bBULvhwfaQR3qYcOfAqz8nx/pD9PK+cmwqoDQ4SYarWYfkk/uiiH jOAO/6HCL06svbQiiqhzaRQFmT4AuHFoXSuqlDuPAUyi3AWHlyeMAsENW0UzMNEwBzI8 vGotynCGi3L5J4I+iD3tyxhdMxG/1I7tPNZMhYcm/5mWttoRoJBQ7XCDUDIEokocYgUj /+zA== MIME-Version: 1.0 In-Reply-To: References: <4d096ff3-e25f-400e-89c6-47483aaacc0d@googlegroups.com> Date: Thu, 4 Oct 2012 09:19:35 -0400 Subject: Re: How to print html in python the normal way From: Joel Goldstick To: Ramchandra Apte Content-Type: text/plain; charset=UTF-8 Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 30 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1349356778 news.xs4all.nl 6883 [2001:888:2000:d::a6]:50026 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:30723 On Thu, Oct 4, 2012 at 9:11 AM, Ramchandra Apte wrote: > On Thursday, 4 October 2012 17:00:57 UTC+5:30, Chris Angelico wrote: >> On Thu, Oct 4, 2012 at 9:24 PM, 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 "Joel a slug", 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