By vinsis
I am trying to launch a simple flask application. I get the following error when I open the website:
[Tue Jan 03 05:06:43.521815 2017] [wsgi:error] [pid 16996] [remote 223.176.176.72:37742] mod_wsgi (pid=16996): Exception occurred processing WSGI script ‘/var/www/myyu/myyu.wsgi’. [Tue Jan 03 05:06:43.521868 2017] [wsgi:error] [pid 16996] [remote 223.176.176.72:37742] Traceback (most recent call last): [Tue Jan 03 05:06:43.521920 2017] [wsgi:error] [pid 16996] [remote 223.176.176.72:37742] File “/var/www/myyu/myyu.wsgi”, line 9, in <module> [Tue Jan 03 05:06:43.521993 2017] [wsgi:error] [pid 16996] [remote 223.176.176.72:37742] from init import app [Tue Jan 03 05:06:43.522019 2017] [wsgi:error] [pid 16996] [remote 223.176.176.72:37742] File “/var/www/myyu/init.py”, line 1, in <module> [Tue Jan 03 05:06:43.522059 2017] [wsgi:error] [pid 16996] [remote 223.176.176.72:37742] from flask import Flask, render_template [Tue Jan 03 05:06:43.522103 2017] [wsgi:error] [pid 16996] [remote 223.176.176.72:37742] ImportError: No module named flask
I tried disabling virtualenv using the following command: a2dissite 000-default I also enable the myyu.conf file I created. My wsgi file looks like: import sys
sys.path.insert(0, “/var/www/myyu”)
from init import app #Put logging code (and imports) here … application = app
Here’s the directory structure: /var/www/myyu: myyu.wsgi init.py
I have also verified that app.run() is under if name == “main”: condition.
Can somebody please help?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
add this code on yout myyu.wsgi file and restart apache
execfile(activate_this, dict(__file__=activate_this))```
find more here http://flask.pocoo.org/docs/0.12/deploying/mod_wsgi/
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.