title: Django optional url parameters
body: <p>I have a Django URL like this:</p>
  
  <pre><code>url(
      r'^project_config/(?P&lt;product&gt;\w+)/(?P&lt;project_id&gt;\w+)/$',
      'tool.views.ProjectConfig',
      name='project_config'
  ),
  </code></pre>
  
  <p><strong>views.py:</strong></p>
  
  <pre><code>def ProjectConfig(request, product, project_id=None, template_name='project.html'):
      ...
      # do stuff
  </code></pre>
  
  <p>The problem is that I want the <code>project_id</code> parameter to be optional.</p>
  
  <p>I want <code>/project_config/</code> and <code>/project_config/12345abdce/</code> to be equally valid URL patterns, so that <strong>if</strong> <code>project_id</code> is passed, <strong>then</strong> I can use it.</p>
  
  <p>As it stands at the moment, I get a 404 when I access the URL without the <code>project_id</code> parameter.</p>