from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from celery import Celery

celery = Celery(__name__, broker='redis://localhost:6379/0')

def create_app(config_name):
    app = Flask(__name__)
    app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://elusuario:12345@localhost:5432/conversordb'
    app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False

    app.config['JWT_SECRET_KEY'] = 'no-hay-frase'
    app.config['PROPAGATE_EXCEPTIONS'] = True
    return app