Flask - Openshift 500内部错误

时间:2015-05-10 10:52:05

标签: python postgresql flask openshift

我一直在与这个问题作斗争。我似乎无法得到原因。我确保所有依赖项都在setup.py中。我已经对应用程序进行了检查并检查了日志。我得到了一个flask-bcrypt ImportError,但我确保将它添加到requirements.txt。

python.log

[Sun Apr 12 15:02:32 2015] [error] [client 127.12.21.1]     raise ImportError('No module named %s' % fullname)
[Sun Apr 12 15:02:32 2015] [error] [client 127.12.21.1] ImportError: No module named flask.ext.bcrypt

postgres.log

2015-04-01 08:59:43 GMT LOG:  could not bind socket for statistics collector: Permission denied
2015-04-01 08:59:43 GMT LOG:  trying another address for the statistics collector
2015-04-01 08:59:43 GMT LOG:  could not bind socket for statistics collector: Cannot assign requested address
2015-04-01 08:59:43 GMT LOG:  disabling statistics collector for lack of working socket
2015-04-01 08:59:43 GMT WARNING:  autovacuum not started because of misconfiguration
2015-04-01 08:59:43 GMT HINT:  Enable the "track_counts" option.
2015-04-01 08:59:43 GMT LOG:  database system was shut down at 2013-05-21 05:07:11 GMT
2015-04-01 08:59:43 GMT LOG:  database system is ready to accept connections
2015-04-01 09:31:35 GMT LOG:  received smart shutdown request
2015-04-01 09:31:35 GMT LOG:  shutting down
2015-04-01 09:31:35 GMT LOG:  database system is shut down

更新 我粘贴了postgres.log,因为'数据库已关闭'消息我得到了。 根据@ydaetskcoR的要求,这里是setup.py

from setuptools import setup

setup(
    name='profile',
    version='1.0',
    description='Create an Online Professional and Personal Profile',
    author='Meke Ladna',
    author_email='ladna_mekelive@yahoo.com',
    url='http://profila-meke.openshift.com/',
    install_requires=
    [
    'Flask==0.10.1',
    'Flask-Login==0.2.7',
    'Flask-SQLAlchemy==1.0',
    'Flask-WTF==0.9.2',
    'Flask-Bcrypt==0.6.2',
    'alembic',
    ],
    )

requirements.txt

<pre>
alembic==0.7.6
decorator==3.4.2
Flask==0.10.1
Flask-Bcrypt==0.6.2
Flask-Login==0.2.7
Flask-SQLAlchemy==1.0
Flask-WTF==0.9.2
itsdangerous==0.24
Jinja2==2.7.3
Mako==1.0.1
MarkupSafe==0.23
psycopg2==2.6
pyparsing==2.0.3
python-bcrypt==0.3.1
six==1.9.0
SQLAlchemy==0.9.9
SQLAlchemy-Searchable==0.9.2
SQLAlchemy-Utils==0.29.9
validators==0.7
Werkzeug==0.10.4
WTForms==2.0.2</pre>

1 个答案:

答案 0 :(得分:0)

我终于能够通过使用python的日志记录来调试问题

<pre>
import logging
app.logger.addHandler(logging.StreamHandler(sys.stdout))
app.logger.setLevel(logging.ERROR)
</pre>

这会将错误记录到openshift中的日志中,结果发现,我的密钥没有在我的环境变量中设置。