22 lines
503 B
Python
22 lines
503 B
Python
|
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)
|