Skip to content

Instantly share code, notes, and snippets.

@rohit-saharan
Created June 4, 2020 13:16

Revisions

  1. Rohit Singh created this gist Jun 4, 2020.
    17 changes: 17 additions & 0 deletions celeryconfig.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    import os
    #env vars used:
    #AWS_REGION: specify which region you want to access SQS from.
    #SQS_URL: The url of the sqs queue to listen for. The AWS keys are picked up
    # from the environment vars that we'll add later while running the worker.
    CELERY_BROKER_TRANSPORT_OPTIONS = {
    'region': os.getenv('AWS_REGION','us-east-1'),
    'predefined_queues': {
    'default': {
    'url': os.getenv('SQS_URL')
    }
    }
    }

    broker_url="sqs://"
    result_backend = 'rpc://'
    enable_utc = True