Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
535 views
in Technique[技术] by (71.8m points)

python - 500内部服务器错误,当我在heroku上部署Flask应用程序时(500 Internal Server Error, when i deployed my flask app on heroku)

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)

This is my init .py file.

(这是我的init .py文件。)

please help me in solving the error!

(请帮助我解决错误!)

First i have got an error and i read the error logs and i pip install gunicorn and added it to the "requirements.txt".

(首先,我有一个错误,我阅读了错误日志,然后点子安装gunicorn并将其添加到“ requirements.txt”中。)

Afterwards, i didn't get any error logs, all i was getting is 500 Internal Server Error!!

(之后,我没有收到任何错误日志,我得到的只是500 Internal Server Error!)

  ask by EC Chaitanya translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...