mirror of
https://github.com/LukeHagar/pypistats.org.git
synced 2025-12-06 04:21:09 +00:00
* update ignore files * setup poetry * add db seeds * black * set up compose * backfill script * add makefile, update readme * update poetry * readme * Fixes * cleanup and rate limit changes * poetry 1.0.5 * some more cleanup * k8s * k8s * update yml * cleanup and admin * deploy
25 lines
567 B
Python
25 lines
567 B
Python
"""Flask extensions."""
|
|
from celery import Celery
|
|
from flask_github import GitHub
|
|
from flask_httpauth import HTTPBasicAuth
|
|
from flask_migrate import Migrate
|
|
from flask_sqlalchemy import SQLAlchemy
|
|
|
|
from pypistats.config import Config
|
|
|
|
db = SQLAlchemy()
|
|
github = GitHub()
|
|
migrate = Migrate()
|
|
auth = HTTPBasicAuth()
|
|
|
|
|
|
def create_celery(name=__name__, config=Config):
|
|
"""Create a celery object."""
|
|
redis_uri = "redis://localhost:6379"
|
|
celery = Celery(name, broker=redis_uri)
|
|
celery.config_from_object(config)
|
|
return celery
|
|
|
|
|
|
celery = create_celery()
|