Not able to run python file which has a import statement for flask, installed via virtualenv.py

python

#1

But…

the same file i am able to run from console using python server.py but this is not causing my application to host on url https://flask-ashishawasthi.c9users.io


#2

You’re probably serving it on the wrong IP and port. You’ll want to add import os to the top of your server.py file then change your last two lines to be:

if __name__ == '__main__':
    app.run(host=os.getenv('IP', '0.0.0.0'),port=int(os.getenv('PORT', 8080)), debug=True)