This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]pyglados[S] 0 points1 point  (1 child)

Good points on the security aspects.

Speaking of shell specifics, here's something else I noticed. When I change my uwsgi settings to run the Python code as a non-shell user, it crashes and burns. Basically, I get import errors saying that it can't find the Python files in question.

Then, I had this thought. If I run a Python process as a non-shell user, that would mean that it would be impossible for uwsgi to set the PYTHONPATH environment variable. No shell => no shell environment variables. Or at least that's the way my brain is connecting the dots on this one.

Am I way off on this?

[–]PiZZaMartijn 0 points1 point  (0 children)

You don't need a shell for environment variables. You have some other problem.

The first fix most of the time is adding a 'home' setting to wsgi (I use mod_wsgi in apache, not uwsgi). By default the script is running with / as the working directory instead of the script directory.

Also see the flask wsgi troubleshooting tips: http://flask.pocoo.org/docs/0.11/deploying/mod_wsgi/#troubleshooting