Answer the question
In order to leave comments, you need to log in
How to write correct regular expression for url?
URL:
url(r'^posts/(?P<account>\w+)/$', views.show_post, name='posts')
test
, everything works fine, but if the account is, let's say, test.test
or test2test
gives a 404 error, I understand that this is the case \w+
. The question is, how can any argument, be it a number, a character or a letter, be passed through a variable to the view?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question