aboutsummaryrefslogtreecommitdiffstats
path: root/config/settings
diff options
context:
space:
mode:
Diffstat (limited to 'config/settings')
-rw-r--r--config/settings/base.py76
-rw-r--r--config/settings/local.py4
-rw-r--r--config/settings/production.py3
3 files changed, 32 insertions, 51 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")
diff --git a/config/settings/local.py b/config/settings/local.py
index e95cbb9..07f38f9 100644
--- a/config/settings/local.py
+++ b/config/settings/local.py
@@ -73,10 +73,6 @@ if env("USE_DOCKER") == "yes":
# ------------------------------------------------------------------------------
# https://django-extensions.readthedocs.io/en/latest/installation_instructions.html#configuration
# INSTALLED_APPS += ["django_extensions"]
-# Celery
-# ------------------------------------------------------------------------------
-# https://docs.celeryq.dev/en/stable/userguide/configuration.html#task-eager-propagates
-CELERY_TASK_EAGER_PROPAGATES = True
# Your stuff...
# ------------------------------------------------------------------------------
diff --git a/config/settings/production.py b/config/settings/production.py
index 9a267e6..fcc772e 100644
--- a/config/settings/production.py
+++ b/config/settings/production.py
@@ -2,7 +2,6 @@
from .base import * # noqa: F403
-from .base import DATABASES
from .base import env
# GENERAL
@@ -14,7 +13,7 @@ ALLOWED_HOSTS = env.list("DJANGO_ALLOWED_HOSTS", default=["alphabetlearning.onli
# DATABASES
# ------------------------------------------------------------------------------
-DATABASES["default"]["CONN_MAX_AGE"] = env.int("CONN_MAX_AGE", default=60)
+# DATABASES["default"]["CONN_MAX_AGE"] = env.int("CONN_MAX_AGE", default=60)
# CACHES
# ------------------------------------------------------------------------------