WIP: Cleanup

This commit is contained in:
Neill Cox 2024-08-10 14:26:12 +10:00
parent 715224653d
commit 6ee942f8dc
37 changed files with 547 additions and 2591 deletions

View file

@ -36,6 +36,15 @@ CSRF_TRUSTED_ORIGINS = [
"https://gcs.neill.id.au",
]
AUTHENTICATION_BACKENDS = [
# Needed to log in by username in Django admin, regardless of `allauth`
'django.contrib.auth.backends.ModelBackend',
# `allauth` specific authentication methods, such as login by email
'allauth.account.auth_backends.AuthenticationBackend',
]
# Application definition
@ -46,10 +55,20 @@ INSTALLED_APPS = [
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
'allauth',
'allauth.account',
'allauth.socialaccount',
# ... include the providers you want to enable:
'allauth.socialaccount.providers.amazon',
'allauth.socialaccount.providers.apple',
'allauth.socialaccount.providers.google',
"django.contrib.staticfiles",
"tailwind",
"theme",
# "tailwind",
# "theme",
"django_browser_reload",
'django_bootstrap_icons',
]
MIDDLEWARE = [
@ -61,6 +80,8 @@ MIDDLEWARE = [
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
"django_browser_reload.middleware.BrowserReloadMiddleware",
# Add the account middleware:
"allauth.account.middleware.AccountMiddleware",
]
ROOT_URLCONF = "django_gurps.urls"
@ -76,6 +97,7 @@ TEMPLATES = [
"django.template.context_processors.request",
"django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages",
'django.template.context_processors.request',
],
},
},
@ -87,12 +109,12 @@ WSGI_APPLICATION = "django_gurps.wsgi.application"
# Database
# https://docs.djangoproject.com/en/5.0/ref/settings/#databases
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": BASE_DIR / "db.sqlite3",
}
}
# DATABASES = {
# "default": {
# "ENGINE": "django.db.backends.sqlite3",
# "NAME": BASE_DIR / "db.sqlite3",
# }
# }
# Password validation
@ -155,3 +177,11 @@ INTERNAL_IPS = [
LOGIN_REDIRECT_URL = "home"
LOGOUT_REDIRECT_URL = "home"
EMAIL_HOST = os.environ["GURPS_SMTP_HOST"]
EMAIL_HOST_USER = os.environ["GURPS_SMTP_USER"]
EMAIL_PORT = os.environ["GURPS_SMTP_PORT"]
EMAIL_HOST_PASSWORD = os.environ["GURPS_EMAIL_PASSWORD"]
EMAIL_USE_SSL = os.environ["GURPS_SMTP_SSL"] == "Y"
DEFAULT_FROM_EMAIL = os.environ["GURPS_EMAIL_ADDRESS"]
ACCOUNT_LOGIN_BY_CODE_ENABLED = True