CORRECCIÓN: arreglar excepciones silenciosas y limpiar scripts

This commit is contained in:
Nachou-u
2026-09-09 08:28:09 -03:00
parent 5d9e0f4589
commit 29c447c23e
11 changed files with 7 additions and 4 deletions
+22
View File
@@ -0,0 +1,22 @@
import re
with open('config/settings.py', 'r') as f:
content = f.read()
middleware = """MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
"""
content = re.sub(r"MIDDLEWARE = \[\n\s+'django\.middleware\.security\.SecurityMiddleware',\n", middleware, content)
static_root = """STATIC_URL = 'static/'
STATIC_ROOT = BASE_DIR / 'staticfiles'
STATICFILES_DIRS = [BASE_DIR / 'static']
"""
content = re.sub(r"STATIC_URL = 'static/'\n", static_root, content)
with open('config/settings.py', 'w') as f:
f.write(content)
with open('requirements.txt', 'a') as f:
f.write('\nwhitenoise==6.7.0\n')