remoção de arquivos desnecessários
This commit is contained in:
parent
826fccf678
commit
ab1445574f
@ -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
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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"),
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user