500内部服务器错误,当我在heroku上部署Flask应用程序时

时间:2019-12-01 10:47:24

标签: python heroku flask

import os
from flask import Flask
from flask_sqlalchemy import SQLAlchemy 
from flask_migrate import Migrate 
from flask_login import LoginManager


app = Flask(__name__)

app.config['SECRET_KEY'] = 'my_secret_key'

basedir=os.path.abspath(os.path.dirname(__file__))
app.config['SQLALCHEMY_DATABASE_URI']='sqlite:///'+os.path.join(basedir, 'data.sqlite')
app.config['SQLALCHEMY_TRACK_MODIFICATIONS']=False 

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


login_manager=LoginManager()

login_manager.init_app(app)
login_manager.login_view='users.login'


from puppycompanyblog.core.views import core
from puppycompanyblog.error_pages.handlers import error_pages
from puppycompanyblog.users.views import users
from puppycompanyblog.blog_posts.views import blog_posts

app.register_blueprint(core)
app.register_blueprint(error_pages)
app.register_blueprint(users)
app.register_blueprint(blog_posts)

这是我的 init .py文件。请帮助我解决错误!

首先,我遇到一个错误,我阅读了错误日志,然后点子安装gunicorn并将其添加到“ requirements.txt”中。之后,我没有得到任何错误日志,我得到的只是500 Internal Server Error !!

0 个答案:

没有答案