Problemas resolvidos
Some checks failed
Creates a docker image for production / Deploy (push) Has been cancelled
Creates a docker image for production / Build the docker image (push) Has been cancelled
Build / Code quality (push) Has been cancelled

This commit is contained in:
2025-02-05 10:04:42 -03:00
parent f3e0e60048
commit 8bcc4e4373
8 changed files with 61 additions and 30 deletions

View File

@@ -1,16 +1,18 @@
import os
from pathlib import Path
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
from .utils import get_op_config
from app.openv import OnePassword
op_config = get_op_config()
SCOPE = os.environ['SCOPE']
OP_ITEM_TITLE = os.environ.get('OP_ITEM_TITLE', 'mines')
SCOPE = op_config['settings.SCOPE']
op_env = OnePassword(SCOPE, OP_ITEM_TITLE)
sentry_sdk.init(
dsn=op_config['settings.SENTRY_DSN'],
dsn=op_env.get('settings.SENTRY_DSN'),
integrations=[DjangoIntegration()],
environment=SCOPE,
send_default_pii=False,
@@ -21,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_config['settings.SECRET_KEY']
SECRET_KEY = op_env.get('settings.SECRET_KEY')
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = op_config.get('settings.DEBUG', '0') in ['1', 'true']
DEBUG = op_env.get('settings.DEBUG', '0') in ['1', 'true']
ALLOWED_HOSTS = op_config.get('settings.ALLOWED_HOSTS', '127.0.0.1,localhost').split(',')
ALLOWED_HOSTS = op_env.get('settings.ALLOWED_HOSTS', '127.0.0.1,localhost').split(',')
# Application definition
INSTALLED_APPS = [
@@ -82,11 +84,11 @@ AUTH_USER_MODEL = 'core.User'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': op_config['database.name'],
'USER': op_config['database.user'],
'PASSWORD': op_config['database.password'],
'HOST': op_config['database.host'],
'PORT': op_config['database.port'],
'NAME': op_env.get('database.name'),
'USER': op_env.get('database.user'),
'PASSWORD': op_env.get('database.password'),
'HOST': op_env.get('database.host'),
'PORT': op_env.get('database.port'),
'OPTIONS': {'charset': 'utf8mb4'},
}
}
@@ -108,7 +110,7 @@ AUTH_PASSWORD_VALIDATORS = [
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
TIME_ZONE = 'America/Sao_Paulo'
USE_I18N = True