If it's a regular Flask app, you just need to set up the WSGI file so that it imports the instance of the Flask
object as application
. For example, if you had a Flask app that looked like this:
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello world!'
...where the instance of the Flask
object is called app
, like it normally is, then your WSGI file would look like this:
import sys
# add your project directory to the sys.path
project_home = u'/home/DrAgus/mysite'
if project_home not in sys.path:
sys.path = [project_home] + sys.path
# import flask app but need to call it "application" for WSGI to work
from flask_app import app as application # noqa
...with appropriate adjustments of the project_home
directory to make it match the directory where your code is, and to flask_app
to make it match the module where the app
variable is defined.