[SOLVED] Deployment via uwsgi: __call__() missing 2 required positional arguments: 'environ' and 'start_response'

EDIT: SOLVED

Solution:

from dashboard import server as application
application # NOTE: Do NOT use parentheses here

Original question:

I’m trying to deploy my dash app on my Gandi simple hosting instance (Python 3.8) via wsgi.

When I format my dash app like this:

app = dash.Dash()
app.config.suppress_callback_exceptions = True
...
if __name__ == '__main__':
    app.run_server(debug=True)

and my wsgi.py file like this:

from dashboard import app as application
application()

I get the error 'Dash' object is not callable.

I read this post on the forum, which suggested that I format my dashboard.py file like this:

from flask import Flask
...
server = Flask(__name__)
server.secret_key ='test'
app = dash.Dash(name = __name__, server = server)
app.config.suppress_callback_exceptions = True

and my wsgi.py file like this:

from dashboard import server as application
application()

but now I’m getting the error __call__() missing 2 required positional arguments: 'environ' and 'start_response'. Is this an issue that is specific to my hosting instance, or something I can work around? Any help is greatly appreciated. I’m pretty new to uwsgi deployment, so apologies if this is a stupid question. I’ll read anything you send my way.

Hi ! I’m struggling a lot to deploy a dash app.
When we had the flask part, do we need at the end to remove this part ? :
if name == ‘main’:
app.run_server(debug=True)