[Answer]-404 on django app when address doesn't have extension (in mezzanine)

1👍

✅

The project urls.py you’ve pasted here at some stage had some comments in great big capital letters describing the exact problem you’re facing, here’s their original source:

https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/project_template/urls.py#L63-L66

0👍

Append slash option makes sure that if the incoming url does not have trailing slash and no url gets match, then it retires after adding trailing slash.
What it does not do is retry after removing trailing slash from incoming url.
Since incoming url does have a trailing slash, you need a / before $
Add / at the end, before $ in all your urls, (r’^getSentiment/$)
Let append slash be true and it should work.

.+ works because . in regex matching anything except newline and you added + after it so it matches any character any number of times, to match . exactly you need to escape it (.)
Making it ^text\..+$

Leave a comment