 <p>You could use this: </p> <p>If this was your url:</p> <pre><code>url(r'(?P&lt;category&gt;[a-z]+)$', 'display', name='dyn_display') reverse('dyn_display', kwargs={'category': 'first'}) </code></pre> <p>To redirect you can use it like this in your view:</p> <pre><code>from django.http import HttpResponseRedirect return HttpResponseRedirect(reverse('dyn_display', kwargs={'category': 'first'})) </code></pre> <p>If this was your url:</p> <pre><code>url(r'$', 'display', name='dyn_dysplay') reverse('dyn_display') </code></pre> <p>To redirect you can use it like this in your view:</p> <pre><code>from django.http import HttpResponseRedirect return HttpResponseRedirect(reverse('dyn_display')) </code></pre> <p>To have a view that could receive an optional value you would need 2 urls:</p> <pre><code>url(r'$', 'display', name='dyn_optional_display') url(r'(?P&lt;category&gt;[a-z]+)$', 'display', name='dyn_display') </code></pre> <p>And then your view:</p> <pre><code>def courses_display(request, category=None): ctx = {} if category: ctx.update({category: 'in'}) return render_to_response('display/basic.html', ctx, context_instance=RequestContext(request)) </code></pre>