Reputation: 3657
I have one existing flask
project under supervisorctl
that works flawlessly!
I added a new flask app called Blog
but this fails to load under supervisorctl.
If I start it manually, it works, by doing:
mongod --dbpath /home/www/blog/mongodb
gunicorn myblog:app -b mysite.com:8080
However, if run the project on supervisorctl
via:
supervisorctl start blog
it does this:
blog: ERROR (abnormal termination)
If I check the stderr
logs, I get:
File "/home/www/blog/myblog.py", line 5, in <module>
from flaskext.markdown import Markdown
ImportError: No module named flaskext.markdown
Supervisor config (.conf):
[program:blog]
command = gunicorn myblog:app -b mysite.com:8080 --loglevel=critical
directory = /home/www/blog
user = myuser
This seems like a simple error - oops I must not have installed flaskext.markdown
right?? Wrong! if I go to my directory with this flask app
, and enable virtualenv
its already installed...
Thus, I am not sure what to do from here? Does anyone have any thoughts? Thank you.
Upvotes: 0
Views: 649
Reputation: 500
You have to add virtualenv path to the command line:
[program:blog]
command = /path/to/virtualenv/bin/gunicorn myblog:app -b mysite.com:8080 --loglevel=critical
directory = /home/www/blog
user = myuser
Save changes, then reload supervisor config and try to start blog again.
Upvotes: 2