0

I can get the filler variable from the URL below just fine.

url(r'^production/(?P<filler>\w{7})/$', views.Filler.as_view()),

In my view I can retrieve the filler as expected. However, if I try to do use a URL like the one below.

url(r'^production/(?P<filler>)\w{7}/(?P<day>).*/$', views.CasesByDay.as_view()),

Both variables (filler, day) are blank.

1 Answer 1

2

You need to include the entire parameter in parenthesis. It looks like you did that in your first example but not the second.

Try:

url(r'^production/(?P<filler>\w{7})/(?P<day>.*)/$', views.CasesByDay.as_view()),

See the official documentation for more information and examples: URL dispatcher

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. I didn't get enough sleep or something, I should have caught a mistake like that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.