hotfix: use dashboard/local_settings.py instead of env vars
My env var loading technique is not allowing local_settings.py to override settings.py. This hotfix disables env vars in favor of local_settings.py. fixes https://gitea.hostea.org/Hostea/dashboard/issues/3pull/4/head
parent
e7446dea2b
commit
3378e61606
|
@ -9,11 +9,6 @@ https://docs.djangoproject.com/en/4.0/topics/settings/
|
|||
For the full list of settings and their values, see
|
||||
https://docs.djangoproject.com/en/4.0/ref/settings/
|
||||
"""
|
||||
import environ
|
||||
import os
|
||||
|
||||
env = environ.Env()
|
||||
|
||||
# Quick-start development settings - unsuitable for production
|
||||
# See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/
|
||||
|
||||
|
@ -31,21 +26,25 @@ ALLOWED_HOSTS = []
|
|||
# https://docs.djangoproject.com/en/4.0/ref/settings/#databases
|
||||
|
||||
DATABASES = {
|
||||
"default": env.db_url(
|
||||
"DATABSE_URL", default="postgres://postgres:password@localhost:5432/postgres"
|
||||
)
|
||||
"default": {
|
||||
"ENGINE": "django.db.backends.postgresql",
|
||||
"NAME": "postgres",
|
||||
"USER": "postgres",
|
||||
"PASSWORD": "password",
|
||||
"HOST": "localhost",
|
||||
"PORT": "5432",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
## django-payments configuration
|
||||
|
||||
PAYMENT_HOST = "http://localhost:8000"
|
||||
PAYMENT_VARIANTS = {
|
||||
"stripe": (
|
||||
"payments.stripe.StripeProvider", # please don't change this
|
||||
"payments.stripe.StripeProvider", # please don't change this
|
||||
{
|
||||
"secret_key": env.get_value("STRIPE_SECRET_KEY"),
|
||||
"public_key": env.get_value("STRIPE_PUBLIC_KEY"),
|
||||
"secret_key": "",
|
||||
"public_key": "",
|
||||
},
|
||||
)
|
||||
}
|
||||
|
@ -78,6 +77,11 @@ HOSTEA = {
|
|||
},
|
||||
}
|
||||
|
||||
EMAIL_CONFIG = env.email("EMAIL_URL", default="smtp://admin:password@localhost:10025")
|
||||
|
||||
vars().update(EMAIL_CONFIG)
|
||||
# Please see EMAIL_* configuration options:
|
||||
# https://docs.djangoproject.com/en/4.1/ref/settings/#email-host
|
||||
EMAIL_HOST = "localhost"
|
||||
EMAIL_USE_TLS = False
|
||||
EMAIL_USE_SSL = False
|
||||
EMAIL_PORT = 10025
|
||||
EMAIL_HOST_USER = "admin"
|
||||
EMAIL_HOST_PASSWORD = "password"
|
||||
|
|
|
@ -9,13 +9,8 @@ https://docs.djangoproject.com/en/4.0/topics/settings/
|
|||
For the full list of settings and their values, see
|
||||
https://docs.djangoproject.com/en/4.0/ref/settings/
|
||||
"""
|
||||
import environ
|
||||
import os
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
env = environ.Env()
|
||||
|
||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||
|
||||
|
@ -86,9 +81,14 @@ WSGI_APPLICATION = "dashboard.wsgi.application"
|
|||
# https://docs.djangoproject.com/en/4.0/ref/settings/#databases
|
||||
|
||||
DATABASES = {
|
||||
"default": env.db_url(
|
||||
"DATABSE_URL", default="postgres://postgres:password@localhost:5432/postgres"
|
||||
)
|
||||
"default": {
|
||||
"ENGINE": "django.db.backends.postgresql",
|
||||
"NAME": "postgres",
|
||||
"USER": "postgres",
|
||||
"PASSWORD": "password",
|
||||
"HOST": "localhost",
|
||||
"PORT": "5432",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -157,8 +157,8 @@ PAYMENT_VARIANTS = {
|
|||
"stripe": (
|
||||
"payments.stripe.StripeProvider",
|
||||
{
|
||||
"secret_key": env.get_value("STRIPE_SECRET_KEY", default=""),
|
||||
"public_key": env.get_value("STRIPE_PUBLIC_KEY", default=""),
|
||||
"secret_key": "",
|
||||
"public_key": "",
|
||||
},
|
||||
)
|
||||
}
|
||||
|
@ -192,9 +192,15 @@ HOSTEA = {
|
|||
},
|
||||
}
|
||||
|
||||
EMAIL_CONFIG = env.email("EMAIL_URL", default="smtp://admin:password@localhost:10025")
|
||||
# Please see EMAIL_* configuration options:
|
||||
# https://docs.djangoproject.com/en/4.1/ref/settings/#email-host
|
||||
EMAIL_HOST = "localhost"
|
||||
EMAIL_USE_TLS = False
|
||||
EMAIL_USE_SSL = False
|
||||
EMAIL_PORT = 10025
|
||||
EMAIL_HOST_USER = "admin"
|
||||
EMAIL_HOST_PASSWORD = "password"
|
||||
|
||||
vars().update(EMAIL_CONFIG)
|
||||
|
||||
try:
|
||||
import dashboard.local_settings
|
||||
|
|
Loading…
Reference in New Issue