Sophie

Sophie

distrib > Fedora > 17 > x86_64 > by-pkgid > b6f82ea76d5134c5709ffcc9dc9e29c5 > files > 455

Django-doc-1.4.5-1.fc17.noarch.rpm


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>django.contrib.markup &mdash; Django 1.4.5 documentation</title>
    
    <link rel="stylesheet" href="../../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../../',
        VERSION:     '1.4.5',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../_static/underscore.js"></script>
    <script type="text/javascript" src="../../_static/doctools.js"></script>
    <link rel="top" title="Django 1.4.5 documentation" href="../../index.html" />
    <link rel="up" title="contrib packages" href="index.html" />
    <link rel="next" title="The messages framework" href="messages.html" />
    <link rel="prev" title="The “local flavor” add-ons" href="localflavor.html" />
 
<script type="text/javascript" src="../../templatebuiltins.js"></script>
<script type="text/javascript">
(function($) {
    if (!django_template_builtins) {
       // templatebuiltins.js missing, do nothing.
       return;
    }
    $(document).ready(function() {
        // Hyperlink Django template tags and filters
        var base = "../templates/builtins.html";
        if (base == "#") {
            // Special case for builtins.html itself
            base = "";
        }
        // Tags are keywords, class '.k'
        $("div.highlight\\-html\\+django span.k").each(function(i, elem) {
             var tagname = $(elem).text();
             if ($.inArray(tagname, django_template_builtins.ttags) != -1) {
                 var fragment = tagname.replace(/_/, '-');
                 $(elem).html("<a href='" + base + "#" + fragment + "'>" + tagname + "</a>");
             }
        });
        // Filters are functions, class '.nf'
        $("div.highlight\\-html\\+django span.nf").each(function(i, elem) {
             var filtername = $(elem).text();
             if ($.inArray(filtername, django_template_builtins.tfilters) != -1) {
                 var fragment = filtername.replace(/_/, '-');
                 $(elem).html("<a href='" + base + "#" + fragment + "'>" + filtername + "</a>");
             }
        });
    });
})(jQuery);
</script>

  </head>
  <body>

    <div class="document">
  <div id="custom-doc" class="yui-t6">
    <div id="hd">
      <h1><a href="../../index.html">Django 1.4.5 documentation</a></h1>
      <div id="global-nav">
        <a title="Home page" href="../../index.html">Home</a>  |
        <a title="Table of contents" href="../../contents.html">Table of contents</a>  |
        <a title="Global index" href="../../genindex.html">Index</a>  |
        <a title="Module index" href="../../py-modindex.html">Modules</a>
      </div>
      <div class="nav">
    &laquo; <a href="localflavor.html" title="The &amp;#8220;local flavor&amp;#8221; add-ons">previous</a> 
     |
    <a href="../index.html" title="API Reference" accesskey="U">up</a>
   |
    <a href="messages.html" title="The messages framework">next</a> &raquo;</div>
    </div>
    
    <div id="bd">
      <div id="yui-main">
        <div class="yui-b">
          <div class="yui-g" id="ref-contrib-markup">
            
  <div class="section" id="s-module-django.contrib.markup">
<span id="s-django-contrib-markup"></span><span id="module-django.contrib.markup"></span><span id="django-contrib-markup"></span><h1>django.contrib.markup<a class="headerlink" href="#module-django.contrib.markup" title="Permalink to this headline">¶</a></h1>
<p>Django provides template filters that implement the following markup
languages:</p>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre">textile</span></tt> &#8211; implements <a class="reference external" href="http://en.wikipedia.org/wiki/Textile_%28markup_language%29">Textile</a> &#8211; requires <a class="reference external" href="http://loopcore.com/python-textile/">PyTextile</a></li>
<li><tt class="docutils literal"><span class="pre">markdown</span></tt> &#8211; implements <a class="reference external" href="http://en.wikipedia.org/wiki/Markdown">Markdown</a> &#8211; requires <a class="reference external" href="http://pypi.python.org/pypi/Markdown">Python-markdown</a></li>
<li><tt class="docutils literal"><span class="pre">restructuredtext</span></tt> &#8211; implements <a class="reference external" href="http://en.wikipedia.org/wiki/ReStructuredText">reST (reStructured Text)</a>
&#8211; requires <a class="reference external" href="http://docutils.sf.net/">doc-utils</a></li>
</ul>
<p>In each case, the filter expects formatted markup as a string and
returns a string representing the marked-up text. For example, the
<tt class="docutils literal"><span class="pre">textile</span></tt> filter converts text that is marked-up in Textile format
to HTML.</p>
<p>To activate these filters, add <tt class="docutils literal"><span class="pre">'django.contrib.markup'</span></tt> to your
<a class="reference internal" href="../settings.html#std:setting-INSTALLED_APPS"><tt class="xref std std-setting docutils literal"><span class="pre">INSTALLED_APPS</span></tt></a> setting. Once you&#8217;ve done that, use
<tt class="docutils literal"><span class="pre">{%</span> <span class="pre">load</span> <span class="pre">markup</span> <span class="pre">%}</span></tt> in a template, and you&#8217;ll have access to these filters.
For more documentation, read the source code in
<tt class="file docutils literal"><span class="pre">django/contrib/markup/templatetags/markup.py</span></tt>.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">The output of markup filters is marked &#8220;safe&#8221; and will not be escaped when
rendered in a template. Always be careful to sanitize your inputs and make
sure you are not leaving yourself vulnerable to cross-site scripting or
other types of attacks.</p>
</div>
<div class="section" id="s-restructured-text">
<span id="restructured-text"></span><h2>reStructured Text<a class="headerlink" href="#restructured-text" title="Permalink to this headline">¶</a></h2>
<p>When using the <tt class="docutils literal"><span class="pre">restructuredtext</span></tt> markup filter you can define a
<a class="reference internal" href="../settings.html#std:setting-RESTRUCTUREDTEXT_FILTER_SETTINGS"><tt class="xref std std-setting docutils literal"><span class="pre">RESTRUCTUREDTEXT_FILTER_SETTINGS</span></tt></a> in your django settings to
override the default writer settings. See the <a class="reference external" href="http://docutils.sourceforge.net/docs/user/config.html#html4css1-writer">restructuredtext writer
settings</a> for details on what these settings are.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">reStructured Text has features that allow raw HTML to be included, and that
allow arbitrary files to be included. These can lead to XSS vulnerabilities
and leaking of private information. It is your responsibility to check the
features of this library and configure appropriately to avoid this. See the
<a class="reference external" href="http://docutils.sourceforge.net/docs/howto/security.html">Deploying Docutils Securely</a> documentation.</p>
</div>
</div>
<div class="section" id="s-id1">
<span id="id1"></span><h2>Markdown<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h2>
<p>The Python Markdown library supports options named &#8220;safe_mode&#8221; and
&#8220;enable_attributes&#8221;. Both relate to the security of the output. To enable both
options in tandem, the markdown filter supports the &#8220;safe&#8221; argument.</p>
<blockquote>
<div>{{ markdown_content_var|markdown:&#8221;safe&#8221; }}</div></blockquote>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">Versions of the Python-Markdown library prior to 2.1 do not support the
optional disabling of attributes and by default they will be included in
any output from the markdown filter - a warning is issued if this is the
case.</p>
</div>
</div>
</div>


          </div>         
        </div>
      </div>
      
        
          <div class="yui-b" id="sidebar">
            
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../../contents.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">django.contrib.markup</a><ul>
<li><a class="reference internal" href="#restructured-text">reStructured Text</a></li>
<li><a class="reference internal" href="#id1">Markdown</a></li>
</ul>
</li>
</ul>

  <h3>Browse</h3>
  <ul>
    
      <li>Prev: <a href="localflavor.html">The &#8220;local flavor&#8221; add-ons</a></li>
    
    
      <li>Next: <a href="messages.html">The messages framework</a></li>
    
  </ul>
  <h3>You are here:</h3>
  <ul>
      <li>
        <a href="../../index.html">Django 1.4.5 documentation</a>
        
          <ul><li><a href="../index.html">API Reference</a>
        
          <ul><li><a href="index.html"><tt class="docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal"><span class="pre">contrib</span></tt> packages</a>
        
        <ul><li>django.contrib.markup</li></ul>
        </li></ul></li></ul>
      </li>
  </ul>  

  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../../_sources/ref/contrib/markup.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
              <h3>Last update:</h3>
              <p class="topless">Feb 21, 2013</p>
          </div> 
        
      
    </div>
    
    <div id="ft">
      <div class="nav">
    &laquo; <a href="localflavor.html" title="The &amp;#8220;local flavor&amp;#8221; add-ons">previous</a> 
     |
    <a href="../index.html" title="API Reference" accesskey="U">up</a>
   |
    <a href="messages.html" title="The messages framework">next</a> &raquo;</div>
    </div>
  </div>

      <div class="clearer"></div>
    </div>
  </body>
</html>