diff options
Diffstat (limited to 'config/settings/base.py')
-rw-r--r-- | config/settings/base.py | 76 |
1 files changed, 31 insertions, 45 deletions
diff --git a/config/settings/base.py b/config/settings/base.py index aaf88fc..a218856 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -44,8 +44,30 @@ LOCALE_PATHS = [str(BASE_DIR / "locale")] # DATABASES # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#databases -DATABASES = {"default": env.db("DATABASE_URL")} -DATABASES["default"]["ATOMIC_REQUESTS"] = True +# DATABASES = {"default": env.db("DATABASE_URL")} +# DATABASES["default"]["ATOMIC_REQUESTS"] = True + +DATABASES = { + "default": { + "ENGINE": "django.db.backends.sqlite3", + "NAME": BASE_DIR / "db.sqlite3", + "OPTIONS": { + "init_command": ( + "PRAGMA foreign_keys=ON;" + "PRAGMA journal_mode = WAL;" + "PRAGMA synchronous = NORMAL;" + "PRAGMA busy_timeout = 5000;" + "PRAGMA temp_store = MEMORY;" + "PRAGMA mmap_size = 134217729;" + "PRAGMA journal_size_limit = 67108864;" + "PRAGMA cache_size = 2000;" + ), + "transaction_mode": "IMMEDIATE", + }, + }, +} + + # https://docs.djangoproject.com/en/stable/ref/settings/#std:setting-DEFAULT_AUTO_FIELD DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" @@ -75,8 +97,7 @@ THIRD_PARTY_APPS = [ "allauth", "allauth.account", "allauth.mfa", - "allauth.socialaccount", - "django_celery_beat", + # "allauth.socialaccount", "django_recaptcha", ] @@ -266,41 +287,6 @@ LOGGING = { "root": {"level": "INFO", "handlers": ["console"]}, } -# Celery -# ------------------------------------------------------------------------------ -# if USE_TZ: -# # https://docs.celeryq.dev/en/stable/userguide/configuration.html#std:setting-timezone -# CELERY_TIMEZONE = TIME_ZONE -# # https://docs.celeryq.dev/en/stable/userguide/configuration.html#std:setting-broker_url -# CELERY_BROKER_URL = env("CELERY_BROKER_URL") -# # https://docs.celeryq.dev/en/stable/userguide/configuration.html#std:setting-result_backend -# CELERY_RESULT_BACKEND = CELERY_BROKER_URL -# # https://docs.celeryq.dev/en/stable/userguide/configuration.html#result-extended -# CELERY_RESULT_EXTENDED = True -# # https://docs.celeryq.dev/en/stable/userguide/configuration.html#result-backend-always-retry -# # https://github.com/celery/celery/pull/6122 -# CELERY_RESULT_BACKEND_ALWAYS_RETRY = True -# # https://docs.celeryq.dev/en/stable/userguide/configuration.html#result-backend-max-retries -# CELERY_RESULT_BACKEND_MAX_RETRIES = 10 -# # https://docs.celeryq.dev/en/stable/userguide/configuration.html#std:setting-accept_content -# CELERY_ACCEPT_CONTENT = ["json"] -# # https://docs.celeryq.dev/en/stable/userguide/configuration.html#std:setting-task_serializer -# CELERY_TASK_SERIALIZER = "json" -# # https://docs.celeryq.dev/en/stable/userguide/configuration.html#std:setting-result_serializer -# CELERY_RESULT_SERIALIZER = "json" -# # https://docs.celeryq.dev/en/stable/userguide/configuration.html#task-time-limit -# # TODO: set to whatever value is adequate in your circumstances -# CELERY_TASK_TIME_LIMIT = 5 * 60 -# # https://docs.celeryq.dev/en/stable/userguide/configuration.html#task-soft-time-limit -# # TODO: set to whatever value is adequate in your circumstances -# CELERY_TASK_SOFT_TIME_LIMIT = 60 -# # https://docs.celeryq.dev/en/stable/userguide/configuration.html#beat-scheduler -# CELERY_BEAT_SCHEDULER = "django_celery_beat.schedulers:DatabaseScheduler" -# # https://docs.celeryq.dev/en/stable/userguide/configuration.html#worker-send-task-events -# CELERY_WORKER_SEND_TASK_EVENTS = True -# # https://docs.celeryq.dev/en/stable/userguide/configuration.html#std-setting-task_send_sent_event -# CELERY_TASK_SEND_SENT_EVENT = True - # django-allauth # ------------------------------------------------------------------------------ ACCOUNT_ALLOW_REGISTRATION = env.bool("DJANGO_ACCOUNT_ALLOW_REGISTRATION", True) @@ -358,12 +344,12 @@ AWS_S3_ENDPOINT_URL = env("SPACES_ENDPOINT_URL") # Your stuff... # ------------------------------------------------------------------------------ -CACHES = { - "default": { - "BACKEND": "django.core.cache.backends.db.DatabaseCache", - "LOCATION": "rate_limit_cache", - }, -} +# CACHES = { +# "default": { +# "BACKEND": "django.core.cache.backends.db.DatabaseCache", +# "LOCATION": "rate_limit_cache", +# }, +# } RECAPTCHA_PUBLIC_KEY = env("RECAPTCHA_PUBLIC_KEY") RECAPTCHA_PRIVATE_KEY = env("RECAPTCHA_PRIVATE_KEY") |