How to solve this problem with regular expressions?

Welcome.

There is a file urls.py
mapping includes = [
...
 url(r'^last/', last_images, name='last_images'),
 url(r'(?P<slug>[-\w]+)/$', show_image, name='show_image'),
 url(r'(?P<slug>[-\w]+)/delete/$', delete_image, name='delete_image'),

]</slug></slug>


The problem is that when you go to the address type /myimage/delete/ are triggered first regular season, and displays an error. How can I solve this problem?
Sometimes their change did not seem quite correct.
Thank you.
July 2nd 19 at 17:29
2 answers
July 2nd 19 at 17:31
Solution
> Places to change them did not seem quite correct.
Why?
Swap them and not take the head.
July 2nd 19 at 17:33
r'^last/'
r'^last/$'

Find more questions by tags Django