декртатор для запуска запланированных задач
This commit is contained in:
@@ -334,6 +334,16 @@ def api_posts():
|
||||
return jsonify({"status": "error"}), 405
|
||||
|
||||
|
||||
def with_app_context(func):
|
||||
def wrapper(*args, **kwargs):
|
||||
from app import app
|
||||
|
||||
with app.app_context():
|
||||
return func(*args, **kwargs)
|
||||
|
||||
return wrapper
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# app.run(debug=True)
|
||||
app.run(debug=True, host="0.0.0.0", port=80)
|
||||
|
||||
Reference in New Issue
Block a user