烧瓶不会给我错误

时间:2020-01-24 18:12:02

标签: python flask

这是我启动Web应用程序的时间

 * Serving Flask app "ucp.py" (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: on
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: 241-130-592
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)

这是它在浏览器中显示的内容:

Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

这是我的__init__.py

from flask import Flask
from config import Config
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_login import LoginManager, login_manager

app = Flask(__name__)
app.config.from_object(Config)

db = SQLAlchemy(app)
migrate = Migrate(app, db)

login = LoginManager(app)
login.login_view = 'login'

app.debug=True

from app import routes, autoload

这是我的.flaskenv

FLASK_APP=ucp.py
FLASK_DEBUG=1

调试处于活动状态,但我没有得到

1 个答案:

答案 0 :(得分:0)

您可能在实施Config时出错,请尝试:

app.config.from_object('config')

其中“ config”是配置文件。