To add optional URL parameters with Python Django, we call add multiple rules for the same URL.
For instance, we write
urlpatterns = patterns('',
url(r'^project_config/$', views.foo),
url(r'^project_config/(?P<product>\w+)/$', views.foo),
url(r'^project_config/(?P<product>\w+)/(?P<project_id>\w+)/$', views.foo),
)
to add 3 URL patterns that has no URL parameters, the product
parameter only, and the product and
project_id` parameters.
And we map all 3 to the same view.