Django URL wildcard with reverse?
<p>In the <a href="https://docs.djangoproject.com/en/1.9/topics/http/urls/#example" rel="nofollow">docs</a>, it say that URL's are tested from top to bottom:</p>

<blockquote>
  <p>/articles/2003/ would match the first pattern in the list, not the second one, because the patterns are tested in order, and the first one is the first test to pass. Feel free to exploit the ordering to insert special cases like this. Here, Django would call the function views.special_case_2003(request)</p>
</blockquote>

<p>But this is not happening in my experience - I want the last URL to be a wildcard to match whatever is not caught by any of the other rules, but this rule ends up catching everything. I have tried putting it at the top, and at the bottom.</p>

<p>Here are the requirements:
 - Anything not caught by other rules should match <code>home</code>.
 - Reverse for <code>home</code> should match the shortest accepted URL, in this case it would be blank.</p>

<p>How can this be accomplished?</p>

<pre><code>urlpatterns = [
    url(r'^admin/', include(admin.site.urls)),
    url(r'^api/', include('project.api')),
    url(r'^', include('places.urls')),
]
</code></pre>

<p><code>places.urls</code>:</p>

<pre><code>app_name = 'places'
urlpatterns = [
    url(r'^([0-9]+)/$', TemplateView.as_view(template_name=app_name + '/detail.html'), name='detail'),
    url(r'^', TemplateView.as_view(template_name=app_name + '/home.html'), name='home'), # Single page app
]
</code></pre>