Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions config/settings/development.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@
LOGGING["loggers"]["ethicalads_ext"]["level"] = "DEBUG"


# Cache
# https://docs.djangoproject.com/en/dev/topics/cache/
# https://github.com/jazzband/django-redis
# --------------------------------------------------------------------------
# Use the Redis cache in development if the REDIS_URL env var is set
if env("REDIS_URL", default=None):
CACHES["default"] = env.cache("REDIS_URL")


# Celery settings for asynchronous tasks
# http://docs.celeryproject.org
# --------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion config/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

# Cache
# https://docs.djangoproject.com/en/dev/topics/cache/
# https://niwinz.github.io/django-redis/
# https://github.com/jazzband/django-redis
# --------------------------------------------------------------------------
CACHES["default"] = env.cache("REDIS_URL")

Expand Down
6 changes: 6 additions & 0 deletions config/settings/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@
},
}

# Always use in-memory cache for testing
CACHES["default"] = {
"BACKEND": "django.core.cache.backends.locmem.LocMemCache",
"LOCATION": "",
}

# Celery should be always eager - there's no distributed celery workers in test
CELERY_TASK_ALWAYS_EAGER = True

Expand Down
4 changes: 3 additions & 1 deletion requirements/production.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ psycopg[binary,pool]
django-anymail

# Redis (cache)
django-redis
# Hiredis is a faster Redis client implementation in C
# https://github.com/jazzband/django-redis?tab=readme-ov-file#pluggable-parsers
django-redis[hiredis]

# Upload files to cloud storage (Azure)
django-storages[azure]
Expand Down
6 changes: 4 additions & 2 deletions requirements/production.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ django-extensions==4.1
# via -r base.in
django-ratelimit==3.0.1
# via -r base.in
django-redis==6.0.0
django-redis[hiredis]==6.0.0
# via -r production.in
django-simple-history==3.10.1
# via -r base.in
Expand All @@ -122,6 +122,8 @@ geoip2==5.1.0
# via -r base.in
gunicorn==23.0.0
# via -r production.in
hiredis==3.3.0
# via redis
idna==3.11
# via
# requests
Expand Down Expand Up @@ -172,7 +174,7 @@ pytz==2025.2
# via -r base.in
qrcode==8.2
# via django-allauth
redis==5.3.1
redis[hiredis]==5.3.1
# via
# celery
# django-redis
Expand Down