tags:

views:

31

answers:

1

I don't know why i can't match url when url is "http://localhost:8000/home/CPM%201.6.1001" since i want pass parameter CPM 201.6.1001 from my template to urls thanks:)

urls.py

urlpatterns = patterns('',
    (r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
    (r'^home/(?P<build>\[^/]+)/$', 'views.run'),   
)

ps. when i use (r'^home/[^/]+/$', 'views.run') it can work, but i can't use this parameter in my views, below is my views:

views.py

def run(request, build):
    ...

i hope get build parameter to present next page. thanks again:)

A: 

do you have there really the following?

(r'^home/(?P<build>\[^/]+)/$', 'views.run')

there is an excessive backslash, correct regexp string is:

r'^home/(?P<build>[^/]+)/$'
mykhal
thanks you very much!
Yuan