Lint fix v1

This commit is contained in:
2025-02-04 15:49:25 -03:00
parent ff010739c4
commit e6c3896918
35 changed files with 392 additions and 432 deletions

View File

@@ -1,8 +1,8 @@
import os
from pathlib import Path
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
from .utils import get_op_config
op_config = get_op_config()
@@ -26,70 +26,70 @@ BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = op_config['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_config.get('settings.DEBUG', '0') in ['1', 'true']
ALLOWED_HOSTS = op_config.get("settings.ALLOWED_HOSTS", "127.0.0.1,localhost").split(",")
ALLOWED_HOSTS = op_config.get('settings.ALLOWED_HOSTS', '127.0.0.1,localhost').split(',')
# Application definition
INSTALLED_APPS = [
"rest_framework",
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
"corsheaders",
"core",
"api",
"game",
'rest_framework',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'corsheaders',
'core',
'api',
'game',
]
MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"corsheaders.middleware.CorsMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = "app.urls"
ROOT_URLCONF = 'app.urls'
TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [],
"APP_DIRS": True,
"OPTIONS": {
"context_processors": [
"django.template.context_processors.debug",
"django.template.context_processors.request",
"django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages",
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = "app.wsgi.application"
WSGI_APPLICATION = 'app.wsgi.application'
AUTH_USER_MODEL = "core.User"
AUTH_USER_MODEL = 'core.User'
# Database
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases
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'],
"OPTIONS": {"charset": "utf8mb4"},
'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'],
'OPTIONS': {'charset': 'utf8mb4'},
}
}
@@ -98,21 +98,19 @@ DATABASES = {
# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator"
},
{"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator"},
{"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator"},
{"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator"},
{'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator'},
{'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator'},
{'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator'},
{'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator'},
]
# Internationalization
# https://docs.djangoproject.com/en/3.1/topics/i18n/
LANGUAGE_CODE = "en-us"
LANGUAGE_CODE = 'en-us'
TIME_ZONE = "UTC"
TIME_ZONE = 'UTC'
USE_I18N = True
@@ -124,15 +122,13 @@ USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.1/howto/static-files/
STATIC_URL = "/static/"
STATIC_URL = '/static/'
# Some Django Rest Framework parameters
REST_FRAMEWORK = {
"DEFAULT_PERMISSION_CLASSES": ["rest_framework.permissions.AllowAny"],
"DEFAULT_AUTHENTICATION_CLASSES": [
"rest_framework.authentication.TokenAuthentication"
],
"DEFAULT_RENDERER_CLASSES": ("rest_framework.renderers.JSONRenderer",),
'DEFAULT_PERMISSION_CLASSES': ['rest_framework.permissions.AllowAny'],
'DEFAULT_AUTHENTICATION_CLASSES': ['rest_framework.authentication.TokenAuthentication'],
'DEFAULT_RENDERER_CLASSES': ('rest_framework.renderers.JSONRenderer',),
}
if DEBUG is True: