diff --git a/.gitignore b/.gitignore
index 4319204..7a51187 100644
--- a/.gitignore
+++ b/.gitignore
@@ -27,3 +27,4 @@ db.sqlite3
# System
.DS_Store
pxy_city_digital_twins/__backup__/
+Dockerfile.dev
diff --git a/docker-compose.override.yml b/docker-compose.override.yml
new file mode 100644
index 0000000..bacf022
--- /dev/null
+++ b/docker-compose.override.yml
@@ -0,0 +1,15 @@
+version: "3.8"
+
+services:
+ web:
+ build:
+ context: .
+ dockerfile: Dockerfile.dev
+ command: >
+ sh -c "python manage.py migrate &&
+ python manage.py runserver 0.0.0.0:8000"
+ ports:
+ - "8011:8000"
+ volumes:
+ - .:/app
+ - ./staticfiles:/app/staticfiles
diff --git a/polisplexity/settings.py b/polisplexity/settings.py
index 6505f1d..3ac8643 100644
--- a/polisplexity/settings.py
+++ b/polisplexity/settings.py
@@ -19,14 +19,22 @@ ALLOWED_HOSTS = os.getenv("ALLOWED_HOSTS", "").split(",")
# Application definition
INSTALLED_APPS = [
+ # Django built-in apps
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
+ "django.contrib.sites", # Required for allauth
- # App modules
+ # Allauth
+ "allauth",
+ "allauth.account",
+ "allauth.socialaccount",
+ "allauth.socialaccount.providers.github", # GitHub login only
+
+ # Your custom apps
"core",
"pxy_de",
"pxy_cr",
@@ -42,14 +50,34 @@ INSTALLED_APPS = [
"pxy_dashboard.apps",
"pxy_dashboard.components",
"pxy_dashboard.layouts",
+
+ # Third-party apps
+ "crispy_forms",
+ "crispy_bootstrap5",
+
]
+CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap5"
+CRISPY_TEMPLATE_PACK = "bootstrap5"
+
+SITE_ID = 1
+
+AUTHENTICATION_BACKENDS = [
+ "django.contrib.auth.backends.ModelBackend", # default
+ "allauth.account.auth_backends.AuthenticationBackend", # allauth support
+]
+
+LOGIN_REDIRECT_URL = "/"
+ACCOUNT_LOGOUT_REDIRECT_URL = "/accounts/login/"
+
+
MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
+ "allauth.account.middleware.AccountMiddleware", # ← Add this line
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
]
@@ -59,7 +87,10 @@ ROOT_URLCONF = "polisplexity.urls"
TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
- "DIRS": [os.path.join(BASE_DIR, "templates")],
+ "DIRS": [
+ os.path.join(BASE_DIR, "templates"),
+ os.path.join(BASE_DIR, "pxy_dashboard", "templates"),
+ ],
"APP_DIRS": True,
"OPTIONS": {
"context_processors": [
@@ -73,6 +104,8 @@ TEMPLATES = [
},
]
+
+
WSGI_APPLICATION = "polisplexity.wsgi.application"
# Database
@@ -132,3 +165,12 @@ CSRF_TRUSTED_ORIGINS = [
# Support for secure reverse proxy (e.g., Nginx or Hostinger HTTPS proxy)
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
+
+
+EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
+EMAIL_HOST = "smtp.hostinger.com"
+EMAIL_PORT = 465
+EMAIL_USE_SSL = True
+EMAIL_HOST_USER = "noreply@polisplexity.tech" # Cambia esto por tu correo real
+EMAIL_HOST_PASSWORD = os.getenv("EMAIL_HOST_PASSWORD") # Mejor usar .env
+DEFAULT_FROM_EMAIL = "Polisplexity