Skip to content

Commit

Permalink
chore: modification de la stratégie de mise en cache (#853)
Browse files Browse the repository at this point in the history
## Description

🎸 Utilisation du backend `django.core.cache.backends.db.DatabaseCache`

## Type de changement

🚧 technique

### Points d'attention

🦺 enjeux : 2 enregistrements uniquement

![image](https://github.com/user-attachments/assets/01b3ddfd-e4a0-4cb1-9346-1f26b8816c38)
  • Loading branch information
vincentporte authored Dec 10, 2024
1 parent 12934df commit 4f974c5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ jobs:
pip install -r requirements/dev.txt
- name: ✨ Black, ruff & djlint
run: make quality
- name: 🚧 create cache table
run: python manage.py createcachetable
- name: 🚧 collect static for testing purposes
run: |
python manage.py collectstatic
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ $ docker-compose --profile django up
## Préparer l'environnement de données

```bash
$ python manage.py createcachetable
$ python manage.py migrate
$ python manage.py populate
$ python manage.py configure_bucket
Expand Down
1 change: 1 addition & 0 deletions clevercloud/python.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"module": "config.wsgi:application",
"managetasks": [
"migrate --no-input",
"createcachetable",
"collectstatic --no-input",
"compilemessages",
"compress"
Expand Down
3 changes: 2 additions & 1 deletion config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,8 @@
# https://docs.djangoproject.com/en/4.1/topics/cache/
CACHES = {
"default": {
"BACKEND": "django.core.cache.backends.locmem.LocMemCache",
"BACKEND": "django.core.cache.backends.db.DatabaseCache",
"LOCATION": "cache_table",
},
"machina_attachments": {
"BACKEND": "django.core.cache.backends.filebased.FileBasedCache",
Expand Down

0 comments on commit 4f974c5

Please sign in to comment.