diff --git a/app/settings.py b/app/settings.py index 0192cc0..b9aa16b 100644 --- a/app/settings.py +++ b/app/settings.py @@ -12,7 +12,7 @@ OP_ITEM_TITLE = os.environ.get('OP_ITEM_TITLE', 'mines') op_env = OnePassword(SCOPE, OP_ITEM_TITLE) sentry_sdk.init( - dsn=op_env.get('settings.SENTRY_DSN'), + dsn=op_env.get('SENTRY_DSN'), integrations=[DjangoIntegration()], environment=SCOPE, send_default_pii=False, @@ -23,12 +23,12 @@ sentry_sdk.init( BASE_DIR = Path(__file__).resolve().parent.parent # SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = op_env.get('settings.SECRET_KEY') +SECRET_KEY = op_env.get('SECRET_KEY') # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = op_env.get('settings.DEBUG', '0') in ['1', 'true'] +DEBUG = op_env.get('DEBUG', '0') in ['1', 'true'] -ALLOWED_HOSTS = op_env.get('settings.ALLOWED_HOSTS', '127.0.0.1,localhost').split(',') +ALLOWED_HOSTS = op_env.get('ALLOWED_HOSTS', '127.0.0.1,localhost').split(',') # Application definition INSTALLED_APPS = [ diff --git a/app/utils.py b/app/utils.py deleted file mode 100644 index b88ad35..0000000 --- a/app/utils.py +++ /dev/null @@ -1,25 +0,0 @@ -import onepasswordconnectsdk -from onepasswordconnectsdk.client import Client, new_client_from_environment - - -def get_op_config(): - op_client: Client = new_client_from_environment() - - OP_DJANGO_SETTINGS_VARS = [ - 'database.host', - 'database.port', - 'database.name', - 'database.user', - 'database.password', - 'settings.ALLOWED_HOSTS', - 'settings.DEBUG', - 'settings.SCOPE', - 'settings.SENTRY_DSN', - 'settings.SECRET_KEY', - ] - - op_config_get = {} - for var in OP_DJANGO_SETTINGS_VARS: - op_config_get[var] = {'opitem': 'mines', 'opfield': var} - - return onepasswordconnectsdk.load_dict(op_client, op_config_get)