remoção de arquivos desnecessários

This commit is contained in:
joao.herculano 2026-05-18 16:39:29 -03:00
parent 826fccf678
commit ab1445574f
7 changed files with 9 additions and 4 deletions

View File

@ -184,7 +184,7 @@ def home_page(request):
- Django CSRF protection ativada
- Configuração segura para produção (altere `DEBUG=False` em settings.py)
- Variáveis sensíveis em .env (recomendado usar python-decouple)
- Variáveis sensíveis em .env (recomendado usar python-dotenv)
## 📚 Adicionar Dependências

View File

@ -14,7 +14,6 @@ class LogIPMiddleware:
ip = self.get_client_ip(request)
# Loga o IP da requisição
print(f"Request from IP: {ip}")
logger.info(f"Request from IP: {ip} - Method: {request.method} - Path: {request.path}")
response = self.get_response(request)

View File

@ -170,7 +170,10 @@ STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles")
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
# CSRF e segurança
CSRF_TRUSTED_ORIGINS = os.getenv('CSRF_TRUSTED_ORIGINS', 'http://localhost:8000,http://127.0.0.1:8000').split(',')
CSRF_TRUSTED_ORIGINS = [origin.strip() for origin in os.getenv(
'CSRF_TRUSTED_ORIGINS',
'http://localhost:8000,http://127.0.0.1:8000'
).split(',') if origin.strip()]
SESSION_COOKIE_SECURE = not DEBUG
CSRF_COOKIE_SECURE = not DEBUG
SESSION_COOKIE_HTTPONLY = True

View File

@ -1,3 +1,4 @@
from django.db import models
# Create your models here.
# Nota: este módulo está vazio por enquanto e pode ser removido ou preenchido quando houver modelos explicitamente necessários.

View File

@ -1,3 +1,4 @@
from django.test import TestCase
# Create your tests here.
# Nota: este módulo está um placeholder. Remova ou adicione testes conforme o projeto evoluir.

View File

@ -4,6 +4,8 @@ from . import views
app_name = "home"
urlpatterns = [
# Esta app é montada em /home/, mas também há um path('/') no projeto
# principal para renderizar a mesma página inicial.
path("", views.home_page, name="home_page"),
path("api/table-data/", views.get_table_data, name="table_data"),
path("api/pivot-data/", views.get_pivot_data, name="pivot_data"),

View File

@ -2,4 +2,3 @@ Django==5.2.5
requests==2.31.0
python-dotenv==1.0.0
gunicorn==21.2.0
python-decouple==3.8