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
|
For the full list of settings and their values, see
|
||||||
https://docs.djangoproject.com/en/4.0/ref/settings/
|
https://docs.djangoproject.com/en/4.0/ref/settings/
|
||||||
"""
|
"""
|
||||||
import environ
|
|
||||||
import os
|
|
||||||
|
|
||||||
env = environ.Env()
|
|
||||||
|
|
||||||
# Quick-start development settings - unsuitable for production
|
# Quick-start development settings - unsuitable for production
|
||||||
# See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/
|
# 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
|
# https://docs.djangoproject.com/en/4.0/ref/settings/#databases
|
||||||
|
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
"default": env.db_url(
|
"default": {
|
||||||
"DATABSE_URL", default="postgres://postgres:password@localhost:5432/postgres"
|
"ENGINE": "django.db.backends.postgresql",
|
||||||
)
|
"NAME": "postgres",
|
||||||
|
"USER": "postgres",
|
||||||
|
"PASSWORD": "password",
|
||||||
|
"HOST": "localhost",
|
||||||
|
"PORT": "5432",
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
## django-payments configuration
|
## django-payments configuration
|
||||||
|
|
||||||
PAYMENT_HOST = "http://localhost:8000"
|
PAYMENT_HOST = "http://localhost:8000"
|
||||||
PAYMENT_VARIANTS = {
|
PAYMENT_VARIANTS = {
|
||||||
"stripe": (
|
"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"),
|
"secret_key": "",
|
||||||
"public_key": env.get_value("STRIPE_PUBLIC_KEY"),
|
"public_key": "",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -78,6 +77,11 @@ 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
|
||||||
vars().update(EMAIL_CONFIG)
|
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
|
For the full list of settings and their values, see
|
||||||
https://docs.djangoproject.com/en/4.0/ref/settings/
|
https://docs.djangoproject.com/en/4.0/ref/settings/
|
||||||
"""
|
"""
|
||||||
import environ
|
|
||||||
import os
|
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
env = environ.Env()
|
|
||||||
|
|
||||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
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
|
# https://docs.djangoproject.com/en/4.0/ref/settings/#databases
|
||||||
|
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
"default": env.db_url(
|
"default": {
|
||||||
"DATABSE_URL", default="postgres://postgres:password@localhost:5432/postgres"
|
"ENGINE": "django.db.backends.postgresql",
|
||||||
)
|
"NAME": "postgres",
|
||||||
|
"USER": "postgres",
|
||||||
|
"PASSWORD": "password",
|
||||||
|
"HOST": "localhost",
|
||||||
|
"PORT": "5432",
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ LANGUAGE_CODE = "en-us"
|
||||||
|
|
||||||
TIME_ZONE = "UTC"
|
TIME_ZONE = "UTC"
|
||||||
|
|
||||||
# not yet implemented so disabling as it provides performance benefits
|
# not yet implemented so disabling as it provides performance benefits
|
||||||
# ref: https://docs.djangoproject.com/en/4.0/topics/i18n/translation/
|
# ref: https://docs.djangoproject.com/en/4.0/topics/i18n/translation/
|
||||||
USE_I18N = False
|
USE_I18N = False
|
||||||
|
|
||||||
|
@ -157,8 +157,8 @@ PAYMENT_VARIANTS = {
|
||||||
"stripe": (
|
"stripe": (
|
||||||
"payments.stripe.StripeProvider",
|
"payments.stripe.StripeProvider",
|
||||||
{
|
{
|
||||||
"secret_key": env.get_value("STRIPE_SECRET_KEY", default=""),
|
"secret_key": "",
|
||||||
"public_key": env.get_value("STRIPE_PUBLIC_KEY", default=""),
|
"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:
|
try:
|
||||||
import dashboard.local_settings
|
import dashboard.local_settings
|
||||||
|
|
Loading…
Reference in New Issue