reorganizing build scripts

This commit is contained in:
badblocks 2025-04-17 12:21:21 -07:00
parent 633c1e87e8
commit b894b60b65
430 changed files with 136 additions and 53943 deletions

View file

@ -1,6 +1,9 @@
import socket
from pathlib import Path
import environ
import os
import logging
import sys
env = environ.Env(
DEBUG=(bool, False)
@ -26,6 +29,31 @@ RESEND_API_KEY = env('RESEND_API_KEY')
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = env('DEBUG')
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'verbose': {
'format': '%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
},
},
'handlers': {
'console': {
'level': 'WARN',
'class': 'logging.StreamHandler',
'stream': sys.stdout,
'formatter': 'verbose'
},
},
'loggers': {
'': {
'handlers': ['console'],
'level': 'WARN',
'propagate': True,
},
},
}
# https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
ALLOWED_HOSTS = env('ALLOWED_HOSTS').split(',')
@ -83,7 +111,7 @@ MIDDLEWARE = [
]
DAISY_SETTINGS = {
'SITE_TITLE': 'PKMN Trade Club Admin',
'SITE_TITLE': 'PKMN Trade Club Admin',
'DONT_SUPPORT_ME': True,
}
@ -160,7 +188,7 @@ STATIC_ROOT = BASE_DIR / "staticfiles"
STATIC_URL = "/static/"
# https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#std:setting-STATICFILES_DIRS
STATICFILES_DIRS = [BASE_DIR / "static"]
STATICFILES_DIRS = []
# https://docs.djangoproject.com/en/dev/ref/settings/#media-root
MEDIA_ROOT = BASE_DIR / "media"
@ -205,8 +233,7 @@ INTERNAL_IPS = [
"127.0.0.1",
]
#for docker development
import socket
# for docker development
hostname, _, ips = socket.gethostbyname_ex(socket.gethostname())
INTERNAL_IPS.append([ip[:-1] + "1" for ip in ips])
@ -241,60 +268,15 @@ ACCOUNT_USERNAME_MIN_LENGTH = 3
ACCOUNT_CHANGE_EMAIL = True
ACCOUNT_UNIQUE_EMAIL = True
ACCOUNT_LOGIN_BY_CODE_ENABLED = True
ACCOUNT_SIGNUP_FORM_HONEYPOT_FIELD = "signature"
ACCOUNT_SIGNUP_FORM_HONEYPOT_FIELD = "website"
ACCOUNT_USERNAME_REQUIRED = True
ACCOUNT_FORMS = {
"signup": "accounts.forms.CustomUserCreationForm",
}
SOCIALACCOUNT_EMAIL_AUTHENTICATION = True
SOCIALACCOUNT_EMAIL_AUTHENTICATION_AUTO_CONNECT = True
SOCIALACCOUNT_EMAIL_AUTHENTICATION = False
SOCIALACCOUNT_EMAIL_AUTHENTICATION_AUTO_CONNECT = False
SOCIALACCOUNT_ONLY = False
# SOCIALACCOUNT_PROVIDERS = {
# "google": {
# # For each OAuth based provider, either add a ``SocialApp``
# # (``socialaccount`` app) containing the required client
# # credentials, or list them here:
# "APPS": [
# {
# "client_id": "123",
# "secret": "456",
# "key": ""
# },
# ],
# # These are provider-specific settings that can only be
# # listed here:
# "SCOPE": [
# "profile",
# "email",
# ],
# "AUTH_PARAMS": {
# "access_type": "offline",
# },
# },
# "openid_connect": {
# # Optional PKCE defaults to False, but may be required by your provider
# # Applies to all APPS.
# "OAUTH_PKCE_ENABLED": True,
# "APPS": [
# {
# "provider_id": "nintendo",
# "name": "Nintendo Account",
# "client_id": "your.service.id",
# "secret": "your.service.secret",
# "settings": {
# "server_url": "https://my.server.example.com",
# # Optional token endpoint authentication method.
# # May be one of "client_secret_basic", "client_secret_post"
# # If omitted, a method from the the server's
# # token auth methods list is used
# "token_auth_method": "client_secret_basic",
# },
# },
# ]
# }
# }
if DEBUG:
CACHES = {
"default": {
@ -307,4 +289,4 @@ else:
"BACKEND": "django.core.cache.backends.db.DatabaseCache",
"LOCATION": "django_cache",
}
}
}