db updation

This commit is contained in:
2026-02-02 12:37:39 +05:30
parent ceff3cc1a0
commit aa84422d10
+12 -11
View File
@@ -8,9 +8,9 @@ load_dotenv()
BASE_DIR = Path(__file__).resolve().parent.parent
# Security
SECRET_KEY = os.getenv("SECRET_KEY", "unsafe-secret-key")
DEBUG = os.getenv("DEBUG", "False") == "True"
ALLOWED_HOSTS = ["*", "civicfix.onrender.com"]
SECRET_KEY = os.getenv("SECRET_KEY")
DEBUG = True
ALLOWED_HOSTS = ["localhost", "127.0.0.1"]
# Installed apps
INSTALLED_APPS = [
@@ -20,8 +20,6 @@ INSTALLED_APPS = [
'django.contrib.humanize',
'django.contrib.sessions',
'django.contrib.messages',
'cloudinary',
'cloudinary_storage',
'django.contrib.staticfiles',
'whitenoise.runserver_nostatic',
'core.apps.CoreConfig',
@@ -59,15 +57,15 @@ TEMPLATES = [
WSGI_APPLICATION = 'civicfix.wsgi.application'
# Database (Render Postgres, fallback to SQLite locally)
# Database (PostgreSQL for Local)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'civicfix_db',
'USER': 'civicfix_user',
'PASSWORD': 'Devs@xw2G7vy&',
'HOST': 'localhost',
'PORT': '5432',
'NAME': os.getenv("DB_NAME"),
'USER': os.getenv("DB_USER"),
'PASSWORD': os.getenv("DB_PASSWORD"),
'HOST': os.getenv("DB_HOST"),
'PORT': os.getenv("DB_PORT"),
}
}
@@ -79,6 +77,7 @@ AUTH_PASSWORD_VALIDATORS = [
{'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator'},
]
# Internationalization
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
@@ -89,6 +88,8 @@ USE_TZ = True
STATIC_URL = "/static/"
STATIC_ROOT = BASE_DIR / "staticfiles"
STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
MEDIA_URL = "/media/"
MEDIA_ROOT = BASE_DIR / "media"
# Auth redirects
LOGIN_REDIRECT_URL = 'citizen_dashboard'