[Fixed]-How can I make Django url regular expression not to catch all words?

1👍

The order matters in pattern matching for URL dispatcher. The first match is resolved and returned.

Django runs through each URL pattern, in order, and stops at the first one that matches the requested URL.

So you might want to move the “specific” patterns higher up.

In other words, move

# ex) /snu/upload
url(r'^(?i)upload/$', views.upload, name='upload'),

to the second position.

Leave a comment