diff --git a/docker/install.sh b/docker/install.sh index e1a87181..d1be570f 100755 --- a/docker/install.sh +++ b/docker/install.sh @@ -24,7 +24,7 @@ DATABASES = { 'PORT': 5432, } } -CELERY_BROKER_URL = "amqp://{0}:{1}@rabbitmq:5672//".format(os.environ.get('RABBITMQ_DEFAULT_USER'), os.environ.get('RABBITMQ_DEFAULT_PASS')) +BROKER_URL = "amqp://{0}:{1}@rabbitmq:5672//".format(os.environ.get('RABBITMQ_DEFAULT_USER'), os.environ.get('RABBITMQ_DEFAULT_PASS')) XACCELREDIRECT = True DEBUG = False diff --git a/pandora/app/__init__.py b/pandora/app/__init__.py index 62c4f9ac..e69de29b 100644 --- a/pandora/app/__init__.py +++ b/pandora/app/__init__.py @@ -1,4 +0,0 @@ - -from .celery import app as celery_app - -__all__ = ('celery_app',) diff --git a/pandora/settings.py b/pandora/settings.py index 1e8f1d56..72a48859 100644 --- a/pandora/settings.py +++ b/pandora/settings.py @@ -200,7 +200,7 @@ CELERY_TASK_SERIALIZER = 'json' CELERY_RESULT_SERIALIZER = 'json' CELERY_ACCEPT_CONTENT = ['json'] -CELERY_BROKER_URL = 'amqp://pandora:box@localhost:5672//pandora' +BROKER_URL = 'amqp://pandora:box@localhost:5672//pandora' SEND_CELERY_ERROR_EMAILS = False @@ -262,10 +262,6 @@ COLLECTION_ICON = join(SCRIPT_ROOT, 'list_icon.py') DB_GIN_TRGM = False -ALLOWED_HOSTS = ['*'] -SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') - -DATA_UPLOAD_MAX_MEMORY_SIZE = 32 * 1024 * 1024 RELOADER_RUNNING = False #you can ignore things below this line @@ -297,4 +293,12 @@ except NameError: INSTALLED_APPS = tuple(list(INSTALLED_APPS) + LOCAL_APPS) +ALLOWED_HOSTS = ['*'] +SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') + +DATA_UPLOAD_MAX_MEMORY_SIZE = 32 * 1024 * 1024 +try: + CELERY_BROKER_URL +except NameError: + CELERY_BROKER_URL = BROKER_URL diff --git a/pandora/websocket/worker.py b/pandora/websocket/worker.py index 72c35e5a..afe0634c 100644 --- a/pandora/websocket/worker.py +++ b/pandora/websocket/worker.py @@ -27,7 +27,7 @@ class Worker(ConsumerMixin): message.ack() def run(): - with Connection(settings.CELERY_BROKER_URL) as conn: + with Connection(settings.BROKER_URL) as conn: try: worker = Worker(conn) worker.run() diff --git a/update.py b/update.py index 41283454..41f322e8 100755 --- a/update.py +++ b/update.py @@ -261,17 +261,6 @@ if __name__ == "__main__": run('./pandora/manage.py', 'createcachetable') if old <= 6108: run('./bin/pip', 'install', '-r', 'requirements.txt') - if old <= 6160: - run('./bin/pip', 'install', '-r', 'requirements.txt') - with open('pandora/local_settings.py', 'r') as f: - local_settings = f.read() - if 'BROKER_URL' in local_settings and 'CELERY_BROKER_URL' not in local_settings: - local_settings = [ - 'CELERY_' + l if l.startswith('BROKER_URL') else l - for l in local_settings.split('\n') - ] - with open('pandora/local_settings.py', 'w') as f: - f.write('\n'.join(local_settings)) else: if len(sys.argv) == 1: branch = get_branch() diff --git a/vm/pandora_install.sh b/vm/pandora_install.sh index 3a62e90d..834060c5 100755 --- a/vm/pandora_install.sh +++ b/vm/pandora_install.sh @@ -117,9 +117,9 @@ if [ "$RABBITMQ" == "local" ]; then rabbitmqctl add_user pandora $RABBITPWD rabbitmqctl add_vhost /pandora rabbitmqctl set_permissions -p /pandora pandora ".*" ".*" ".*" - CELERY_BROKER_URL="amqp://pandora:$RABBITPWD@localhost:5672//pandora" + BROKER_URL="amqp://pandora:$RABBITPWD@localhost:5672//pandora" else - CELERY_BROKER_URL="$RABBITMQ" + BROKER_URL="$RABBITMQ" fi # checkout pandora from git @@ -145,7 +145,7 @@ DATABASES = { 'PASSWORD': '', } } -CELERY_BROKER_URL = '$CELERY_BROKER_URL' +BROKER_URL = '$BROKER_URL' XACCELREDIRECT = True DEBUG = False