Update CSS optimization (using CDN for bootstrap) and mysql compat
This commit is contained in:
Binary file not shown.
+30
-8
@@ -118,13 +118,30 @@ WSGI_APPLICATION = 'proyecto.wsgi.application'
|
||||
|
||||
# Database
|
||||
# https://docs.djangoproject.com/en/6.0/ref/settings/#databases
|
||||
# Activa MySQL con MYSQL_ENABLED=True en el .env; si no, se usa SQLite.
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
'NAME': BASE_DIR / 'db.sqlite3',
|
||||
if env_bool('MYSQL_ENABLED', False):
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.mysql',
|
||||
'NAME': os.getenv('MYSQL_DATABASE', 'tienda'),
|
||||
'USER': os.getenv('MYSQL_USER', 'root'),
|
||||
'PASSWORD': os.getenv('MYSQL_PASSWORD', ''),
|
||||
'HOST': os.getenv('MYSQL_HOST', '127.0.0.1'),
|
||||
'PORT': env_int('MYSQL_PORT', 3306),
|
||||
'OPTIONS': {
|
||||
'charset': 'utf8mb4',
|
||||
'init_command': "SET sql_mode='STRICT_TRANS_TABLES'",
|
||||
},
|
||||
}
|
||||
}
|
||||
else:
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
'NAME': BASE_DIR / 'db.sqlite3',
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Password validation
|
||||
@@ -328,14 +345,19 @@ EMAIL_HOST_PASSWORD = SMTP_PASSWORD
|
||||
DEFAULT_FROM_EMAIL = os.getenv("DEFAULT_FROM_EMAIL", SMTP_EMAIL)
|
||||
|
||||
# URL de Redis (asumiendo que corre en el puerto default 6379)
|
||||
CELERY_BROKER_URL = 'redis://localhost:6379/0'
|
||||
CELERY_BROKER_URL = os.getenv("REDIS_URL", "redis://localhost:6379/0")
|
||||
|
||||
# Opcional: para guardar el resultado de las tareas
|
||||
CELERY_RESULT_BACKEND = 'redis://localhost:6379/0'
|
||||
CELERY_RESULT_BACKEND = os.getenv("REDIS_URL", "redis://localhost:6379/0")
|
||||
|
||||
# Configuraciones adicionales recomendadas
|
||||
CELERY_ACCEPT_CONTENT = ['json']
|
||||
CELERY_TASK_SERIALIZER = 'json'
|
||||
CELERY_RESULT_SERIALIZER = 'json'
|
||||
|
||||
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
|
||||
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
|
||||
|
||||
USE_X_FORWARDED_HOST = True
|
||||
SECURE_REFERER_POLICY = "strict-origin-when-cross-origin"
|
||||
|
||||
print(f"DEBUG: ALLOWED_HOSTS is {ALLOWED_HOSTS}")
|
||||
Reference in New Issue
Block a user