Flask not running

I am trying to get flask running on my server, This is the code I’m running


import sys, os
INTERP = “/home/username/sub.domain.com/bin/python”
if sys.executable != INTERP:
os.execl(INTERP, INTERP, *sys.argv)

from flask import Flask
application = Flask(name)

def index():
return ‘Hello from Passenger’

And I am getting this error.

Traceback (most recent call last):
  File "/usr/share/passenger/helper-scripts/wsgi-loader.py", line 325, in <module>
    app_module = load_app()
  File "/usr/share/passenger/helper-scripts/wsgi-loader.py", line 62, in load_app
    return imp.load_source('passenger_wsgi', startup_file)
NameError: global name 'imp' is not defined

Does this mean there is something wrong internally?

May be your problem can be solved here https://stackoverflow.com/questions/20943899/flask-hello-py-basic-app-not-running. if you want to ask anything you can ask me here

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.