Reverse model admin custom URLs
<p>Inside my <code>admin.py</code> file I have:</p>

<pre><code>def get_urls(self):
    urls = super(TextAdmin, self).get_urls()
    my_urls = patterns('',
        url(
            r'customfunc1',
            customfunc2,
            name='customfunc23',
        ),
    )
    return my_urls + urls
</code></pre>

<p>Which will enable the following URL:</p>

<pre><code>http://localhost:8000/admin/text/customfunc1
</code></pre>

<p>Which will execute function <code>customfunc2</code>. My question is now how would I reference this URL through doing <code>reverse</code>?</p>

<p>I tried:</p>

<pre><code>reverse("admin:text_customfunc1")
reverse("admin:text_customfunc2")
reverse("admin:text_customfunc3")
reverse("text:customfunc1")
</code></pre>

<p>But none of those work.</p>

<p>You have <code>name='customfunc23'</code>, and it is in the <code>admin</code> app, so you should use:</p>

<pre><code>reverse('admin:customfunc23')
</code></pre>

python django python-2.7 django-admin