feat: Add deploy environment, Add pyprojectoml

This commit is contained in:
2026-05-09 19:09:31 -05:00
parent 6bc76282d1
commit 294dbdee91
22 changed files with 1475 additions and 203 deletions

View File

@@ -0,0 +1,92 @@
"""
Development settings for tienda_ilusion project.
This file contains settings specific to local development environment.
Uses SQLite database and permissive CORS settings for easier development.
"""
import os
from .base import *
# SECURITY WARNING: don't use this in production!
DEBUG = True
# SECRET_KEY for development (insecure, but convenient for development)
SECRET_KEY = os.environ.get(
"SECRET_KEY",
"django-insecure-development-key-zh6rinl@8y7g(cf781snisx2j%p^c#d&b2@@9cqe!v@4yv8x=v",
)
# Allow all hosts in development for easier testing
ALLOWED_HOSTS = os.environ.get("ALLOWED_HOSTS", "localhost,127.0.0.1,0.0.0.0").split(
","
)
# CORS settings for development
CORS_ALLOWED_ORIGINS = os.environ.get(
"CORS_ALLOWED_ORIGINS",
"http://localhost:3000,http://localhost:7001,http://localhost:5173",
).split(",")
# Allow credentials in CORS for development
CORS_ALLOW_CREDENTIALS = True
# Database - SQLite for development
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": BASE_DIR / "db.sqlite3",
}
}
# Email backend for development (prints to console)
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
# Enhanced logging for development
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"formatters": {
"verbose": {
"format": "[{levelname}] {asctime} {module} {message}",
"style": "{",
},
},
"handlers": {
"console": {
"class": "logging.StreamHandler",
"formatter": "verbose",
},
},
"root": {
"handlers": ["console"],
"level": "DEBUG",
},
"loggers": {
"django": {
"handlers": ["console"],
"level": "INFO",
"propagate": False,
},
"django.db.backends": {
"handlers": ["console"],
"level": "DEBUG",
"propagate": False,
},
},
}
# Development-only apps (optional)
# Uncomment to add django-debug-toolbar or other dev tools
# INSTALLED_APPS += [
# 'debug_toolbar',
# ]
# MIDDLEWARE += [
# 'debug_toolbar.middleware.DebugToolbarMiddleware',
# ]
# INTERNAL_IPS for debug toolbar
# INTERNAL_IPS = [
# '127.0.0.1',
# ]