Django url parameter passing
What you're looking for are captured parameters
Below is a code snippet from the above link.
# urls.py
from django.conf.urls import patterns, url
urlpatterns = patterns('blog.views',
url(r'^blog/(?P<year>\d{4})/$', 'year_archive', {'foo': 'bar'}),
)
# views.py
def year_archive(request, year, foo=None):
# view method definition