I already posted this question in the forum, but since I could not figure out a solution yet, I thought I might try it again...
GOAL: I want to serve protected static files from Django, so that I can assure, that only users that are logged in can access the files.
As I could not find a solution using the below mentioned setting, I looked at johns suggestion again... However it says
"Support for mod_python has been deprecated within Django. At that time, this method of authentication will no longer be provided by Django."
Though I could still make it work, it does not look like the way you should do it... Any other suggestions? What is the best way to reach the mentioned goal?
1) Passenger/Nginx: I installed the passenger application and configured nginx like this:
2) In the Webfaction panel I edit my site so that „/protected“ leads to the passenger app.
3) In django I try to access the files with the following code:
PROBLEM: As long as I leave the „internal“ in the nginx configuration, I cannot access the files (Nginx shows a 404). However, without the interal it works (that means the path should be correct).
Is the request from the django app not handled as "internal"? Or does anyone see what the problem could be?
Thanks for your help!!!
Not sure if you have thought about using apache to serve the files. This seems to be the supported way to do this,
You would have to replace your current deployment with one of our pre-built apache stacks and make the appropriate changes.
answered Oct 26 '10 at 17:12
The request would definitely not be an "internal" request. It would be just a normal HTTP request to the URL.
You did say it works without the "internal" directory, correct?
answered Oct 27 '10 at 03:16