ValueError:对于带有基数10的int()的无效文字:' False'

时间:2016-08-18 04:33:12

标签: python flask-mail

知道如何解决这个问题吗?

Traceback (most recent call last):
  File "manage.py", line 1, in <module>
    from punchstarter import manager
  File "/app/punchstarter/__init__.py", line 29, in <module>
    mail = Mail(app)
  File "/app/.heroku/python/lib/python2.7/site-packages/flask_mail.py",     line 539, in __init__
    self.state = self.init_app(app)
  File "/app/.heroku/python/lib/python2.7/site-packages/flask_mail.py", line 566, in init_app
    state = self.init_mail(app.config, app.debug, app.testing)
  File "/app/.heroku/python/lib/python2.7/site-packages/flask_mail.py", line 552, in init_mail
    int(config.get('MAIL_DEBUG', debug)),
ValueError: invalid literal for int() with base 10: 'False'

来自__init__.py第29行:

mail = Mail(app)

我正在运行python,我认为flask_mail配置存在一些问题,但我不确定问题所在。

1 个答案:

答案 0 :(得分:1)

app.debug = 0

这对我有用

mail = Mail()  
app.debug = 0  
mail.init_app(app)