Flask not running

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

#!/usr/bin/python3

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

from flask import Flask
application = Flask(name)

@application.route(’/’)
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.