1

I have a Flask application that I'm trying to configure for a production environment. So far, during testing python app.py inside of a virtualenv works fine.

However, I'm beginning to configure the application to begin using UWSGI. When I attempt to start the Flask app using

$ uwsgi -s /tmp/myapplication.sock --manage-script-name --mount /myapplication=app:app --virtualenv /path/to/my/venv

I get a

ModuleNotFoundError: No module named 'flask_httpauth'

I was wondering if anyone has experience w/ that authentication module and if they have any advice on what I should do. I'm unsure of why the development server starts without an issue, but the uwsgi server (that I pass the same virtualenv that's used for the dev server) runs into import issues

help-info.de
  • 6,695
  • 16
  • 39
  • 41
  • Check that you've installed `flask_httpauth` in your virtual environment. – Fine Sep 11 '18 at 08:03
  • @Fian Is there something special I need to do for that? I did a pip install in the virtual env, and as I said it runs w/ `python`, so I'm assuming it's installed. – Nicholas Johnson Sep 11 '18 at 13:10

1 Answers1

0

I was able to resolve this issue by setting the home path to my virtualenv directory (.venv in my case):

# uwsgi.ini
home = /Users/floatingrock/Desktop/projects/google_v2/.venv/

If you're wondering, I got the full path using pwd.

FloatingRock
  • 6,741
  • 6
  • 42
  • 75