1👍
✅
Your encpw variable ends in a newline character, by default the . regular expression character does not capture these. Try altering your regex so the DOTALL flag is turned on, which will match for newline characters.
url(r'(?s)^getimage/(?P<extractedcontent_id>\d+)/(?P<encpw>.*)/$','getimagecontent',name='getimagefile'),
Notice the (?s)
at the very beginning this will turn the DOTALL flag on.
1👍
You don’t show where encpw
comes from, but it appears to have a newline character (\n
) at the end, which won’t match the url regex.
- [Answered ]-Serving protected files with Django and Nginx X-accel-redirect
- [Answered ]-What is the right way to setup urls.py for django-rest-framework + angular-route + static files?
Source:stackexchange.com