Issues with Deploying Dash App Using Gunicorn

Hello everyone,

I’m currently facing some challenges while deploying my Dash app using Gunicorn, and I’m hoping to get some guidance from the community.

I’ve built a Dash app that interacts with a MongoDB database and I’m trying to deploy it using Gunicorn. The app runs without any issues locally, but when I try to run it with Gunicorn, I encounter the following error:

Traceback (most recent call last):
  File "gunicorn", line 8, in <module>
    sys.exit(run())

gunicorn.errors.AppImportError: Failed to find attribute ‘app’ in ‘app’.

I have a Flask server with a Dash app and I’ve set up a Blueprint for a cloud API that interacts with a MongoDB database. The app runs successfully when using app.run_server(debug=True) locally, but the issue arises when trying to deploy it with Gunicorn.

# Create Flask app and Dash app
server = Flask(__name__)
app = dash. Dash(__name__, server=server)

# Define cloud API Blueprint
cloud_api_bp = Blueprint('cloud_api', __name__)

Fixed it.

Instead of using gunicorn Just used. python3 app.py

On the start script.
Worked without any issues.

Hi there,

Glad you got the issue resolved! Thanks for letting us know.

Regards,
Mike


Render Support Engineer, MT (UTC-7)

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