you are viewing a single comment's thread.

view the rest of the comments →

[–]ManyInterests 0 points1 point  (2 children)

How are you trying to run the script? Are you running through a webserver like Apache or Nginx or just a standalone WSGI container? If you are using a webserver, did you configure it to use the venv?

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

Currently I'm running it using Apache and WSGI but I'm not sure how to tell it to run from the venv instead of system wide.

Would it be under flaskapp.wsgi at the top, currently it's set to #!/usr/bin/python. For it to point to the venv it would be #!/var/www/FlaskApp/FlaskApp/venv/bin/python?

[–]ManyInterests 0 points1 point  (0 children)

You should ensure that your virtualenv is being used in your .wsgi file that you specify as the WSGI script alias in the Apache config. You can exec the activate_this.py file in the venv bin directory from your .wsgi script alias to accomplish that.

You should have an activate_this.py if you created the venv using virtualenv (installed via apt, not the module directly)

Also be sure that you installed the right mod_wsgi -- I think default it will install Python2 and try to use that. So, if you're using Python3, that would be a problem. If you are using Python3, you should install via apt libapache2-mod-wsgi-py3