我正在尝试使用cPanel部署我的Flask网站,但是当我尝试打开website时,它提示我 500 Internal Server Error 。
stderr.log
azure_rm_virtualmachinescaleset_facts
azure_rm_virtualmachinescalesetinstance_facts
azure_rm_virtualmachine_facts
azure_rm_subnet_facts
azure_rm_networkinterface_facts
passenger_wsgi.py
* Serving Flask app "app" (lazy loading)
* Serving Flask app "app" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
Traceback (most recent call last):
File "/home2/pucomput/production/passenger_wsgi.py", line 27, in <module>
application = flask_app.run()
File "/home2/pucomput/virtualenv/production/3.7/lib/python3.7/site-packages/flask/app.py", line 939, in run
cli.show_server_banner(self.env, self.debug, self.name, False)
File "/home2/pucomput/virtualenv/production/3.7/lib/python3.7/site-packages/flask/cli.py", line 641, in show_server_banner
click.echo(message)
File "/home2/pucomput/virtualenv/production/3.7/lib/python3.7/site-packages/click/utils.py", line 261, in echo
file.flush()
BrokenPipeError: [Errno 32] Broken pipe
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
app / __ init __。py
from app import *
application = flask_app.run()
我不确定我的网站发生了什么。但是,当我尝试运行一个最小的网站时,它运行良好。
from flask import Flask
flask_app = Flask(__name__, template_folder="view")
from app.controller import *