添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

I have a Dash app that runs fine locally. It also renders as a pythonanywhere website but it has none of the functionality that it should. It appears to be only static and the browser tabs title shows "Updating".

When I check the error logs I find:

Error running WSGI application AttributeError: 'Flask' object has no attribute 'server' File "/var/www/mpetta_pythonanywhere_com_wsgi.py", line 18, in <module> application = app.server

I have tried renaming the file and aliasing the import but nothing seems to resolve this error. Any help would be greatly appreciated. Thank you

I have this line in textgen_app.py :

app = Dash(__name__, external_stylesheets=[dbc.themes.BOOTSTRAP])

And this is the wsgi.py :

import sys
project_home = '/home/mpetta/textgen'
if project_home not in sys.path:
    sys.path = [project_home] + sys.path
from textgen_app import app
application = app.server
              

it seems all the paths and directories are pointing to where I want them to.

When I launch the app I get this in the error log:

Error running WSGI application AttributeError: 'Flask' object has no attribute 'server' File "/var/www/mpetta_pythonanywhere_com_wsgi.py", line 18, in <module> application = app.server

Oddly enough the app is then available at mpetta.pythonanywhere.com but it doesn't allow for the input and output callbacks that Dash should allow. It only displays the page elements. When I attempt to use a callback such as submitting user input the error log shows:

OSError: write error

I followed the information provided on that page. Per that recommendation, this is exactly what I have in the wsgi.py file:

import sys
project_home = '/home/mpetta/textgen'
if project_home not in sys.path:
    sys.path = [project_home] + sys.path
from textgen_app import app
application = app.server

Even following that pages guide the deployment throws the error:

"Error running WSGI application AttributeError: 'Flask' object has no attribute 'server' File "/var/www/mpetta_pythonanywhere_com_wsgi.py", line 18, in <module> application = app.server"

Why is the error log showing this "WSGI application AttributeError" but the page elements for the app all display at the URL. If the WSGI.py is failing then there should be nothing showing on the URL. is that assumption correct?

Sorry, we have had to rate-limit your feedback sending.
Please try again in a few moments... Thanks for the feedback! Our tireless devs will get back to you soon.