DAS_2023_1/antonov_dmitry_lab4/rabbit/app.py

22 lines
503 B
Python
Raw Normal View History

2023-12-04 20:01:33 +04:00
from celery import Celery
from flask import Flask, render_template
app = Flask(__name__)
# Celery конфигурация
app.config['CELERY_BROKER_URL'] = 'pyamqp://guest:guest@localhost//'
app.config['CELERY_RESULT_BACKEND'] = 'rpc://'
# Создаем инстанс Celery
celery = Celery(app.name, broker=app.config['CELERY_BROKER_URL'])
celery.conf.update(app.config)
@app.route('/')
def index():
return render_template('index.html')
if __name__ == '__main__':
app.run(debug=True)