Sophie

Sophie

distrib > Mageia > 6 > armv7hl > media > core-updates > by-pkgid > 65530c6176058f9b54858c3b4f6385e6 > files > 795

python-django-doc-1.8.19-1.mga6.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" lang="">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>django.core.urlresolvers utility functions &#8212; Django 1.8.19 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.8.19',
        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="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="top" title="Django 1.8.19 documentation" href="../contents.html" />
    <link rel="up" title="API Reference" href="index.html" />
    <link rel="next" title="django.conf.urls utility functions" href="urls.html" />
    <link rel="prev" title="Unicode data" href="unicode.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 role="document">

    <div class="document">
  <div id="custom-doc" class="yui-t6">
    <div id="hd">
      <h1><a href="../index.html">Django 1.8.19 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="unicode.html" title="Unicode data">previous</a>
     |
    <a href="index.html" title="API Reference" accesskey="U">up</a>
   |
    <a href="urls.html" title="&lt;code class=&#34;docutils literal&#34;&gt;&lt;span class=&#34;pre&#34;&gt;django.conf.urls&lt;/span&gt;&lt;/code&gt; utility functions">next</a> &raquo;</div>
    </div>

    <div id="bd">
      <div id="yui-main">
        <div class="yui-b">
          <div class="yui-g" id="ref-urlresolvers">
            
  <div class="section" id="s-module-django.core.urlresolvers">
<span id="s-django-core-urlresolvers-utility-functions"></span><span id="module-django.core.urlresolvers"></span><span id="django-core-urlresolvers-utility-functions"></span><h1><code class="docutils literal"><span class="pre">django.core.urlresolvers</span></code> utility functions<a class="headerlink" href="#module-django.core.urlresolvers" title="Permalink to this headline">¶</a></h1>
<div class="section" id="s-reverse">
<span id="reverse"></span><h2>reverse()<a class="headerlink" href="#reverse" title="Permalink to this headline">¶</a></h2>
<p>If you need to use something similar to the <a class="reference internal" href="templates/builtins.html#std:templatetag-url"><code class="xref std std-ttag docutils literal"><span class="pre">url</span></code></a> template tag in
your code, Django provides the following function:</p>
<dl class="function">
<dt id="django.core.urlresolvers.reverse">
<code class="descname">reverse</code>(<em>viewname</em>, <em>urlconf=None</em>, <em>args=None</em>, <em>kwargs=None</em>, <em>current_app=None</em>)<a class="reference internal" href="../_modules/django/core/urlresolvers.html#reverse"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django.core.urlresolvers.reverse" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<p><code class="docutils literal"><span class="pre">viewname</span></code> can be a string containing the Python path to the view object, a
<a class="reference internal" href="../topics/http/urls.html#naming-url-patterns"><span class="std std-ref">URL pattern name</span></a>, or the callable view object.
For example, given the following <code class="docutils literal"><span class="pre">url</span></code>:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">news</span> <span class="k">import</span> <span class="n">views</span>

<span class="n">url</span><span class="p">(</span><span class="s1">r&#39;^archive/$&#39;</span><span class="p">,</span> <span class="n">views</span><span class="o">.</span><span class="n">archive</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="s1">&#39;news-archive&#39;</span><span class="p">)</span>
</pre></div>
</div>
<p>you can use any of the following to reverse the URL:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="c1"># using the named URL</span>
<span class="n">reverse</span><span class="p">(</span><span class="s1">&#39;news-archive&#39;</span><span class="p">)</span>

<span class="c1"># passing a callable object</span>
<span class="c1"># (This is discouraged because you can&#39;t reverse namespaced views this way.)</span>
<span class="kn">from</span> <span class="nn">news</span> <span class="k">import</span> <span class="n">views</span>
<span class="n">reverse</span><span class="p">(</span><span class="n">views</span><span class="o">.</span><span class="n">archive</span><span class="p">)</span>
</pre></div>
</div>
<p>If the URL accepts arguments, you may pass them in <code class="docutils literal"><span class="pre">args</span></code>. For example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">django.core.urlresolvers</span> <span class="k">import</span> <span class="n">reverse</span>

<span class="k">def</span> <span class="nf">myview</span><span class="p">(</span><span class="n">request</span><span class="p">):</span>
    <span class="k">return</span> <span class="n">HttpResponseRedirect</span><span class="p">(</span><span class="n">reverse</span><span class="p">(</span><span class="s1">&#39;arch-summary&#39;</span><span class="p">,</span> <span class="n">args</span><span class="o">=</span><span class="p">[</span><span class="mi">1945</span><span class="p">]))</span>
</pre></div>
</div>
<p>You can also pass <code class="docutils literal"><span class="pre">kwargs</span></code> instead of <code class="docutils literal"><span class="pre">args</span></code>. For example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">reverse</span><span class="p">(</span><span class="s1">&#39;admin:app_list&#39;</span><span class="p">,</span> <span class="n">kwargs</span><span class="o">=</span><span class="p">{</span><span class="s1">&#39;app_label&#39;</span><span class="p">:</span> <span class="s1">&#39;auth&#39;</span><span class="p">})</span>
<span class="go">&#39;/admin/auth/&#39;</span>
</pre></div>
</div>
<p><code class="docutils literal"><span class="pre">args</span></code> and <code class="docutils literal"><span class="pre">kwargs</span></code> cannot be passed to <code class="docutils literal"><span class="pre">reverse()</span></code> at the same time.</p>
<p>If no match can be made, <code class="docutils literal"><span class="pre">reverse()</span></code> raises a
<a class="reference internal" href="exceptions.html#django.core.urlresolvers.NoReverseMatch" title="django.core.urlresolvers.NoReverseMatch"><code class="xref py py-class docutils literal"><span class="pre">NoReverseMatch</span></code></a> exception.</p>
<p>The <code class="docutils literal"><span class="pre">reverse()</span></code> function can reverse a large variety of regular expression
patterns for URLs, but not every possible one. The main restriction at the
moment is that the pattern cannot contain alternative choices using the
vertical bar (<code class="docutils literal"><span class="pre">&quot;|&quot;</span></code>) character. You can quite happily use such patterns for
matching against incoming URLs and sending them off to views, but you cannot
reverse such patterns.</p>
<p>The <code class="docutils literal"><span class="pre">current_app</span></code> argument allows you to provide a hint to the resolver
indicating the application to which the currently executing view belongs.
This <code class="docutils literal"><span class="pre">current_app</span></code> argument is used as a hint to resolve application
namespaces into URLs on specific application instances, according to the
<a class="reference internal" href="../topics/http/urls.html#topics-http-reversing-url-namespaces"><span class="std std-ref">namespaced URL resolution strategy</span></a>.</p>
<p>The <code class="docutils literal"><span class="pre">urlconf</span></code> argument is the URLconf module containing the url patterns to
use for reversing. By default, the root URLconf for the current thread is used.</p>
<div class="deprecated">
<p><span class="versionmodified">Deprecated since version 1.8: </span>The ability to reverse using the Python path, e.g.
<code class="docutils literal"><span class="pre">reverse('news.views.archive')</span></code>, has been deprecated.</p>
</div>
<div class="admonition-make-sure-your-views-are-all-correct admonition">
<p class="first admonition-title">Make sure your views are all correct.</p>
<p>As part of working out which URL names map to which patterns, the
<code class="docutils literal"><span class="pre">reverse()</span></code> function has to import all of your URLconf files and examine
the name of each view. This involves importing each view function. If
there are <em>any</em> errors whilst importing any of your view functions, it
will cause <code class="docutils literal"><span class="pre">reverse()</span></code> to raise an error, even if that view function is
not the one you are trying to reverse.</p>
<p class="last">Make sure that any views you reference in your URLconf files exist and can
be imported correctly. Do not include lines that reference views you
haven&#8217;t written yet, because those views will not be importable.</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p>The string returned by <code class="docutils literal"><span class="pre">reverse()</span></code> is already
<a class="reference internal" href="unicode.html#uri-and-iri-handling"><span class="std std-ref">urlquoted</span></a>. For example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">reverse</span><span class="p">(</span><span class="s1">&#39;cities&#39;</span><span class="p">,</span> <span class="n">args</span><span class="o">=</span><span class="p">[</span><span class="s1">&#39;Orléans&#39;</span><span class="p">])</span>
<span class="go">&#39;.../Orl%C3%A9ans/&#39;</span>
</pre></div>
</div>
<p class="last">Applying further encoding (such as <a class="reference internal" href="utils.html#django.utils.http.urlquote" title="django.utils.http.urlquote"><code class="xref py py-meth docutils literal"><span class="pre">urlquote()</span></code></a> or
<code class="docutils literal"><span class="pre">urllib.quote</span></code>) to the output of <code class="docutils literal"><span class="pre">reverse()</span></code> may produce undesirable
results.</p>
</div>
</div>
<div class="section" id="s-reverse-lazy">
<span id="reverse-lazy"></span><h2>reverse_lazy()<a class="headerlink" href="#reverse-lazy" title="Permalink to this headline">¶</a></h2>
<p>A lazily evaluated version of <a class="reference internal" href="#reverse">reverse()</a>.</p>
<dl class="function">
<dt id="django.core.urlresolvers.reverse_lazy">
<code class="descname">reverse_lazy</code>(<em>viewname</em>, <em>urlconf=None</em>, <em>args=None</em>, <em>kwargs=None</em>, <em>current_app=None</em>)<a class="headerlink" href="#django.core.urlresolvers.reverse_lazy" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<p>It is useful for when you need to use a URL reversal before your project&#8217;s
URLConf is loaded. Some common cases where this function is necessary are:</p>
<ul class="simple">
<li>providing a reversed URL as the <code class="docutils literal"><span class="pre">url</span></code> attribute of a generic class-based
view.</li>
<li>providing a reversed URL to a decorator (such as the <code class="docutils literal"><span class="pre">login_url</span></code> argument
for the <a class="reference internal" href="../topics/auth/default.html#django.contrib.auth.decorators.permission_required" title="django.contrib.auth.decorators.permission_required"><code class="xref py py-func docutils literal"><span class="pre">django.contrib.auth.decorators.permission_required()</span></code></a>
decorator).</li>
<li>providing a reversed URL as a default value for a parameter in a function&#8217;s
signature.</li>
</ul>
</div>
<div class="section" id="s-resolve">
<span id="resolve"></span><h2>resolve()<a class="headerlink" href="#resolve" title="Permalink to this headline">¶</a></h2>
<p>The <code class="docutils literal"><span class="pre">resolve()</span></code> function can be used for resolving URL paths to the
corresponding view functions. It has the following signature:</p>
<dl class="function">
<dt id="django.core.urlresolvers.resolve">
<code class="descname">resolve</code>(<em>path</em>, <em>urlconf=None</em>)<a class="reference internal" href="../_modules/django/core/urlresolvers.html#resolve"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django.core.urlresolvers.resolve" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<p><code class="docutils literal"><span class="pre">path</span></code> is the URL path you want to resolve. As with
<a class="reference internal" href="#django.core.urlresolvers.reverse" title="django.core.urlresolvers.reverse"><code class="xref py py-func docutils literal"><span class="pre">reverse()</span></code></a>, you don&#8217;t need to
worry about the <code class="docutils literal"><span class="pre">urlconf</span></code> parameter. The function returns a
<a class="reference internal" href="#django.core.urlresolvers.ResolverMatch" title="django.core.urlresolvers.ResolverMatch"><code class="xref py py-class docutils literal"><span class="pre">ResolverMatch</span></code></a> object that allows you
to access various meta-data about the resolved URL.</p>
<p>If the URL does not resolve, the function raises a
<a class="reference internal" href="exceptions.html#django.core.urlresolvers.Resolver404" title="django.core.urlresolvers.Resolver404"><code class="xref py py-exc docutils literal"><span class="pre">Resolver404</span></code></a> exception (a subclass of
<a class="reference internal" href="../topics/http/views.html#django.http.Http404" title="django.http.Http404"><code class="xref py py-class docutils literal"><span class="pre">Http404</span></code></a>) .</p>
<dl class="class">
<dt id="django.core.urlresolvers.ResolverMatch">
<em class="property">class </em><code class="descname">ResolverMatch</code><a class="reference internal" href="../_modules/django/core/urlresolvers.html#ResolverMatch"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django.core.urlresolvers.ResolverMatch" title="Permalink to this definition">¶</a></dt>
<dd><dl class="attribute">
<dt id="django.core.urlresolvers.ResolverMatch.func">
<code class="descname">func</code><a class="headerlink" href="#django.core.urlresolvers.ResolverMatch.func" title="Permalink to this definition">¶</a></dt>
<dd><p>The view function that would be used to serve the URL</p>
</dd></dl>

<dl class="attribute">
<dt id="django.core.urlresolvers.ResolverMatch.args">
<code class="descname">args</code><a class="headerlink" href="#django.core.urlresolvers.ResolverMatch.args" title="Permalink to this definition">¶</a></dt>
<dd><p>The arguments that would be passed to the view function, as
parsed from the URL.</p>
</dd></dl>

<dl class="attribute">
<dt id="django.core.urlresolvers.ResolverMatch.kwargs">
<code class="descname">kwargs</code><a class="headerlink" href="#django.core.urlresolvers.ResolverMatch.kwargs" title="Permalink to this definition">¶</a></dt>
<dd><p>The keyword arguments that would be passed to the view
function, as parsed from the URL.</p>
</dd></dl>

<dl class="attribute">
<dt id="django.core.urlresolvers.ResolverMatch.url_name">
<code class="descname">url_name</code><a class="headerlink" href="#django.core.urlresolvers.ResolverMatch.url_name" title="Permalink to this definition">¶</a></dt>
<dd><p>The name of the URL pattern that matches the URL.</p>
</dd></dl>

<dl class="attribute">
<dt id="django.core.urlresolvers.ResolverMatch.app_name">
<code class="descname">app_name</code><a class="headerlink" href="#django.core.urlresolvers.ResolverMatch.app_name" title="Permalink to this definition">¶</a></dt>
<dd><p>The application namespace for the URL pattern that matches the
URL.</p>
</dd></dl>

<dl class="attribute">
<dt id="django.core.urlresolvers.ResolverMatch.namespace">
<code class="descname">namespace</code><a class="headerlink" href="#django.core.urlresolvers.ResolverMatch.namespace" title="Permalink to this definition">¶</a></dt>
<dd><p>The instance namespace for the URL pattern that matches the
URL.</p>
</dd></dl>

<dl class="attribute">
<dt id="django.core.urlresolvers.ResolverMatch.namespaces">
<code class="descname">namespaces</code><a class="headerlink" href="#django.core.urlresolvers.ResolverMatch.namespaces" title="Permalink to this definition">¶</a></dt>
<dd><p>The list of individual namespace components in the full
instance namespace for the URL pattern that matches the URL.
i.e., if the namespace is <code class="docutils literal"><span class="pre">foo:bar</span></code>, then namespaces will be
<code class="docutils literal"><span class="pre">['foo',</span> <span class="pre">'bar']</span></code>.</p>
</dd></dl>

<dl class="attribute">
<dt id="django.core.urlresolvers.ResolverMatch.view_name">
<code class="descname">view_name</code><a class="headerlink" href="#django.core.urlresolvers.ResolverMatch.view_name" title="Permalink to this definition">¶</a></dt>
<dd><p>The name of the view that matches the URL, including the namespace if
there is one.</p>
</dd></dl>

</dd></dl>

<p>A <a class="reference internal" href="#django.core.urlresolvers.ResolverMatch" title="django.core.urlresolvers.ResolverMatch"><code class="xref py py-class docutils literal"><span class="pre">ResolverMatch</span></code></a> object can then be interrogated to provide
information about the URL pattern that matches a URL:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="c1"># Resolve a URL</span>
<span class="n">match</span> <span class="o">=</span> <span class="n">resolve</span><span class="p">(</span><span class="s1">&#39;/some/path/&#39;</span><span class="p">)</span>
<span class="c1"># Print the URL pattern that matches the URL</span>
<span class="nb">print</span><span class="p">(</span><span class="n">match</span><span class="o">.</span><span class="n">url_name</span><span class="p">)</span>
</pre></div>
</div>
<p>A <a class="reference internal" href="#django.core.urlresolvers.ResolverMatch" title="django.core.urlresolvers.ResolverMatch"><code class="xref py py-class docutils literal"><span class="pre">ResolverMatch</span></code></a> object can also be assigned to a triple:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">func</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">kwargs</span> <span class="o">=</span> <span class="n">resolve</span><span class="p">(</span><span class="s1">&#39;/some/path/&#39;</span><span class="p">)</span>
</pre></div>
</div>
<p>One possible use of <a class="reference internal" href="#django.core.urlresolvers.resolve" title="django.core.urlresolvers.resolve"><code class="xref py py-func docutils literal"><span class="pre">resolve()</span></code></a> would be to test
whether a view would raise a <code class="docutils literal"><span class="pre">Http404</span></code> error before redirecting to it:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">django.core.urlresolvers</span> <span class="k">import</span> <span class="n">resolve</span>
<span class="kn">from</span> <span class="nn">django.http</span> <span class="k">import</span> <span class="n">HttpResponseRedirect</span><span class="p">,</span> <span class="n">Http404</span>
<span class="kn">from</span> <span class="nn">django.utils.six.moves.urllib.parse</span> <span class="k">import</span> <span class="n">urlparse</span>

<span class="k">def</span> <span class="nf">myview</span><span class="p">(</span><span class="n">request</span><span class="p">):</span>
    <span class="nb">next</span> <span class="o">=</span> <span class="n">request</span><span class="o">.</span><span class="n">META</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;HTTP_REFERER&#39;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> <span class="ow">or</span> <span class="s1">&#39;/&#39;</span>
    <span class="n">response</span> <span class="o">=</span> <span class="n">HttpResponseRedirect</span><span class="p">(</span><span class="nb">next</span><span class="p">)</span>

    <span class="c1"># modify the request and response as required, e.g. change locale</span>
    <span class="c1"># and set corresponding locale cookie</span>

    <span class="n">view</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">kwargs</span> <span class="o">=</span> <span class="n">resolve</span><span class="p">(</span><span class="n">urlparse</span><span class="p">(</span><span class="nb">next</span><span class="p">)[</span><span class="mi">2</span><span class="p">])</span>
    <span class="n">kwargs</span><span class="p">[</span><span class="s1">&#39;request&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">request</span>
    <span class="k">try</span><span class="p">:</span>
        <span class="n">view</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
    <span class="k">except</span> <span class="n">Http404</span><span class="p">:</span>
        <span class="k">return</span> <span class="n">HttpResponseRedirect</span><span class="p">(</span><span class="s1">&#39;/&#39;</span><span class="p">)</span>
    <span class="k">return</span> <span class="n">response</span>
</pre></div>
</div>
</div>
<div class="section" id="s-get-script-prefix">
<span id="get-script-prefix"></span><h2>get_script_prefix()<a class="headerlink" href="#get-script-prefix" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="django.core.urlresolvers.get_script_prefix">
<code class="descname">get_script_prefix</code>()<a class="reference internal" href="../_modules/django/core/urlresolvers.html#get_script_prefix"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django.core.urlresolvers.get_script_prefix" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<p>Normally, you should always use <a class="reference internal" href="#django.core.urlresolvers.reverse" title="django.core.urlresolvers.reverse"><code class="xref py py-func docutils literal"><span class="pre">reverse()</span></code></a> to
define URLs within your application. However, if your application constructs
part of the URL hierarchy itself, you may occasionally need to generate URLs.
In that case, you need to be able to find the base URL of the Django project
within its Web server (normally, <a class="reference internal" href="#django.core.urlresolvers.reverse" title="django.core.urlresolvers.reverse"><code class="xref py py-func docutils literal"><span class="pre">reverse()</span></code></a>
takes care of this for you). In that case, you can call
<code class="docutils literal"><span class="pre">get_script_prefix()</span></code>, which will return the script prefix portion of the URL
for your Django project. If your Django project is at the root of its web
server, this is always <code class="docutils literal"><span class="pre">&quot;/&quot;</span></code>.</p>
</div>
</div>


          </div>
        </div>
      </div>
      
        
          <div class="yui-b" id="sidebar">
            
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../contents.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#"><code class="docutils literal"><span class="pre">django.core.urlresolvers</span></code> utility functions</a><ul>
<li><a class="reference internal" href="#reverse">reverse()</a></li>
<li><a class="reference internal" href="#reverse-lazy">reverse_lazy()</a></li>
<li><a class="reference internal" href="#resolve">resolve()</a></li>
<li><a class="reference internal" href="#get-script-prefix">get_script_prefix()</a></li>
</ul>
</li>
</ul>

  <h3>Browse</h3>
  <ul>
    
      <li>Prev: <a href="unicode.html">Unicode data</a></li>
    
    
      <li>Next: <a href="urls.html"><code class="docutils literal"><span class="pre">django.conf.urls</span></code> utility functions</a></li>
    
  </ul>
  <h3>You are here:</h3>
  <ul>
      <li>
        <a href="../index.html">Django 1.8.19 documentation</a>
        
          <ul><li><a href="index.html">API Reference</a>
        
        <ul><li><code class="docutils literal"><span class="pre">django.core.urlresolvers</span></code> utility functions</li></ul>
        </li></ul>
      </li>
  </ul>

  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../_sources/ref/urlresolvers.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <form class="search" action="../search.html" method="get">
      <div><input type="text" name="q" /></div>
      <div><input type="submit" value="Go" /></div>
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
              <h3>Last update:</h3>
              <p class="topless">Mar 10, 2018</p>
          </div>
        
      
    </div>

    <div id="ft">
      <div class="nav">
    &laquo; <a href="unicode.html" title="Unicode data">previous</a>
     |
    <a href="index.html" title="API Reference" accesskey="U">up</a>
   |
    <a href="urls.html" title="&lt;code class=&#34;docutils literal&#34;&gt;&lt;span class=&#34;pre&#34;&gt;django.conf.urls&lt;/span&gt;&lt;/code&gt; utility functions">next</a> &raquo;</div>
    </div>
  </div>

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