Я пытаюсь развернуть свой python - flask бэкэнд на heroku при использовании flask -mail. Все отлично работает на локальном хосте. Но мой сервер продолжает зависать на героку.
from flask import Flask, jsonify, request
from flask_mail import Mail, Message
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['TESTING'] = False
app.config['MAIL_SERVER'] = 'mail.gmx.com'
app.config['MAIL_PORT'] = 587
app.config['MAIL_USE_TLS'] = True
app.config['MAIL_USE_SSL'] = False
app.config['MAIL_USERNAME'] = 'some-email'
app.config['MAIL_PASSWORD'] = 'some-password'
app.config['MAIL_DEFAULT_SENDER'] = ('Some email', 'some-email')
app.config['MAIL_MAX_EMAILS'] = None
app.config['MAIL_ASCII_ATTACHMENTS'] = False
mail = Mail(app)
@app.route('/mail')
def send():
msg = Message('Welcome!', recipients=['some-email'])
msg.html = '<b>Welcome to Wx Safe Flight! Enjoy, and may good weather be with you!</b>'
mail.send(msg)
return 'Message has been sent!'
if __name__ == '__main__':
app.run(threaded=True, port=5000)