import newrelic.agent import os # Environments DEV_ENVIRONMENT = 'dev' PROD_ENVIRONMENT = 'prod' QA_ENVIRONMENT = 'qa' TEST_ENVIRONMENT = 'test' environment = os.environ.get('Environment', DEV_ENVIRONMENT) # Local storage and allowed files. UPLOAD_FOLDER = '/tmp' ALLOWED_EXTENSIONS = {'xlsx'} # Configuration of S3 AWS_REGION = os.environ.get('AWS_REGION') bucket_name = '{env}-orcdbucket'.format(env=environment) prefix = '/managerights/' xlsx_prefix = '/ows-xlsx/' # Configuration of simple queue service # Note: this will automatically be prefixed by the queue_prefix param broker_queue_name = 'default' queue_prefix = '{}-ows-bulkperformancerights-'.format(environment) celery_broker = 'sqs://' if environment == TEST_ENVIRONMENT: celery_broker = 'sqla+sqlite://' # Database config DB_URL = os.environ.get('DB_URL') AR_DB_URL = os.environ.get('AR_DB_URL') # Email config EMAIL_FROM_ADDRESS = 'donotreply@theorchard.com' # Workstation config WORKSTATION_BASE_URL = 'https://workstation.theorchard.com' if environment == QA_ENVIRONMENT: WORKSTATION_BASE_URL = 'http://workstation.qaorch.com' IMAGES_BASE_URL = 'https://images.theorchard.com' # Configuration of external services. # XLSX 2 JSON: Transforms a XLSX into a json document. # Raven: track exceptions and errors. xlsx_to_json_base_url = os.environ.get('XLSXTOJSON_URL') raven_dsn = os.environ.get('RAVEN_DSN') # New Relic # --------- # TODO: move this to a common initializer file instead if environment not in (DEV_ENVIRONMENT, TEST_ENVIRONMENT): newrelic.agent.initialize('newrelic.ini')