import newrelic.agent import os ALLOWED_EXTENSIONS = ['xlsx'] DEV_ENVIRONMENT = 'dev' TEST_ENVIRONMENT = 'test' PROD_ENVIRONMENT = 'prod' environment = os.environ.get('Environment', DEV_ENVIRONMENT) # the application bucket containing the json & xlsx folders bucket_name = environment + '-orcdbucket' # used for both the local temp folder and the s3 folder/prefix prefix = 'ows-xlsx' # local temp dir temp_dir = os.path.join('/tmp', prefix) raven_dsn = os.environ.get('RAVEN_DSN') # Celery configuration # -------------------- # Celery is using sqs as a broker. For each process that consumes the queue a # pidbox queue is automatically created. Each queue is prefixed with # {env}-ows-xlsx-, and the default queue name is default. queue_prefix = '{}-ows-xlsx-'.format(environment) broker_queue_name = 'default' celery_broker = 'sqs://' celery_results_db = os.environ.get('RESULTS_DB_URI') if environment == TEST_ENVIRONMENT: celery_broker = 'sqla+sqlite:////tmp/xlsx_broker.db' celery_results_db = 'db+sqlite:////tmp/xlsx_results.db' # New Relic # --------- # TODO: move this to a common initializer file instead if environment not in (DEV_ENVIRONMENT, TEST_ENVIRONMENT): newrelic.agent.initialize('newrelic.ini')