mirror of https://gitlab.crans.org/bde/nk20
Use memcached cache
This commit is contained in:
parent
d54ab94ceb
commit
3d733ed6af
|
@ -17,7 +17,7 @@ py37-django22:
|
||||||
python3-django python3-django-crispy-forms
|
python3-django python3-django-crispy-forms
|
||||||
python3-django-extensions python3-django-filters python3-django-polymorphic
|
python3-django-extensions python3-django-filters python3-django-polymorphic
|
||||||
python3-djangorestframework python3-django-oauth-toolkit python3-psycopg2 python3-pil
|
python3-djangorestframework python3-django-oauth-toolkit python3-psycopg2 python3-pil
|
||||||
python3-babel python3-lockfile python3-pip python3-phonenumbers
|
python3-babel python3-lockfile python3-pip python3-phonenumbers python3-memcache
|
||||||
python3-bs4 python3-setuptools tox texlive-xetex
|
python3-bs4 python3-setuptools tox texlive-xetex
|
||||||
script: tox -e py37-django22
|
script: tox -e py37-django22
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ py38-django22:
|
||||||
python3-django python3-django-crispy-forms
|
python3-django python3-django-crispy-forms
|
||||||
python3-django-extensions python3-django-filters python3-django-polymorphic
|
python3-django-extensions python3-django-filters python3-django-polymorphic
|
||||||
python3-djangorestframework python3-django-oauth-toolkit python3-psycopg2 python3-pil
|
python3-djangorestframework python3-django-oauth-toolkit python3-psycopg2 python3-pil
|
||||||
python3-babel python3-lockfile python3-pip python3-phonenumbers
|
python3-babel python3-lockfile python3-pip python3-phonenumbers python3-memcache
|
||||||
python3-bs4 python3-setuptools tox texlive-xetex
|
python3-bs4 python3-setuptools tox texlive-xetex
|
||||||
script: tox -e py38-django22
|
script: tox -e py38-django22
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ RUN apt-get update && \
|
||||||
python3-django python3-django-crispy-forms \
|
python3-django python3-django-crispy-forms \
|
||||||
python3-django-extensions python3-django-filters python3-django-polymorphic \
|
python3-django-extensions python3-django-filters python3-django-polymorphic \
|
||||||
python3-djangorestframework python3-django-oauth-toolkit python3-psycopg2 python3-pil \
|
python3-djangorestframework python3-django-oauth-toolkit python3-psycopg2 python3-pil \
|
||||||
python3-babel python3-lockfile python3-pip python3-phonenumbers ipython3 \
|
python3-babel python3-lockfile python3-pip python3-phonenumbers python3-memcache ipython3 \
|
||||||
python3-bs4 python3-setuptools \
|
python3-bs4 python3-setuptools \
|
||||||
uwsgi uwsgi-plugin-python3 \
|
uwsgi uwsgi-plugin-python3 \
|
||||||
texlive-xetex gettext libjs-bootstrap4 fonts-font-awesome && \
|
texlive-xetex gettext libjs-bootstrap4 fonts-font-awesome && \
|
||||||
|
|
|
@ -94,9 +94,9 @@ Sinon vous pouvez suivre les étapes décrites ci-dessous.
|
||||||
python3-django python3-django-crispy-forms \
|
python3-django python3-django-crispy-forms \
|
||||||
python3-django-extensions python3-django-filters python3-django-polymorphic \
|
python3-django-extensions python3-django-filters python3-django-polymorphic \
|
||||||
python3-djangorestframework python3-django-oauth-toolkit python3-psycopg2 python3-pil \
|
python3-djangorestframework python3-django-oauth-toolkit python3-psycopg2 python3-pil \
|
||||||
python3-babel python3-lockfile python3-pip python3-phonenumbers ipython3 \
|
python3-babel python3-lockfile python3-pip python3-phonenumbers python3-memcache ipython3 \
|
||||||
python3-bs4 python3-setuptools \
|
python3-bs4 python3-setuptools \
|
||||||
uwsgi uwsgi-plugin-python3 \
|
memcached uwsgi uwsgi-plugin-python3 \
|
||||||
texlive-xetex gettext libjs-bootstrap4 fonts-font-awesome \
|
texlive-xetex gettext libjs-bootstrap4 fonts-font-awesome \
|
||||||
nginx python3-venv git acl
|
nginx python3-venv git acl
|
||||||
```
|
```
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
- python3-django-polymorphic
|
- python3-django-polymorphic
|
||||||
- python3-djangorestframework
|
- python3-djangorestframework
|
||||||
- python3-lockfile
|
- python3-lockfile
|
||||||
|
- python3-memcache
|
||||||
- python3-phonenumbers
|
- python3-phonenumbers
|
||||||
- python3-pil
|
- python3-pil
|
||||||
- python3-pip
|
- python3-pip
|
||||||
|
@ -40,6 +41,9 @@
|
||||||
# LaTeX (PDF generation)
|
# LaTeX (PDF generation)
|
||||||
- texlive-xetex
|
- texlive-xetex
|
||||||
|
|
||||||
|
# Cache server
|
||||||
|
- memcached
|
||||||
|
|
||||||
# WSGI server
|
# WSGI server
|
||||||
- uwsgi
|
- uwsgi
|
||||||
- uwsgi-plugin-python3
|
- uwsgi-plugin-python3
|
||||||
|
|
|
@ -216,6 +216,16 @@ EMAIL_HOST_PASSWORD = os.getenv('EMAIL_PASSWORD', None)
|
||||||
SERVER_EMAIL = os.getenv("NOTE_MAIL", "notekfet@example.com")
|
SERVER_EMAIL = os.getenv("NOTE_MAIL", "notekfet@example.com")
|
||||||
DEFAULT_FROM_EMAIL = "NoteKfet2020 <" + SERVER_EMAIL + ">"
|
DEFAULT_FROM_EMAIL = "NoteKfet2020 <" + SERVER_EMAIL + ">"
|
||||||
|
|
||||||
|
# Cache
|
||||||
|
# https://docs.djangoproject.com/en/2.2/topics/cache/#setting-up-the-cache
|
||||||
|
cache_address = os.getenv("CACHE_ADDRESS", "127.0.0.1:11211")
|
||||||
|
CACHES = {
|
||||||
|
'default': {
|
||||||
|
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
|
||||||
|
'LOCATION': cache_address,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# Django REST Framework
|
# Django REST Framework
|
||||||
REST_FRAMEWORK = {
|
REST_FRAMEWORK = {
|
||||||
'DEFAULT_PERMISSION_CLASSES': [
|
'DEFAULT_PERMISSION_CLASSES': [
|
||||||
|
|
|
@ -24,6 +24,14 @@ if os.getenv("DJANGO_DEV_STORE_METHOD", "sqlite") != "postgresql":
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Dummy cache for development
|
||||||
|
# https://docs.djangoproject.com/en/2.2/topics/cache/#setting-up-the-cache
|
||||||
|
CACHES = {
|
||||||
|
'default': {
|
||||||
|
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# Break it, fix it!
|
# Break it, fix it!
|
||||||
DEBUG = True
|
DEBUG = True
|
||||||
|
|
||||||
|
|
|
@ -13,5 +13,6 @@ django-polymorphic~=2.0.3
|
||||||
djangorestframework~=3.9.0
|
djangorestframework~=3.9.0
|
||||||
django-rest-polymorphic~=0.1.9
|
django-rest-polymorphic~=0.1.9
|
||||||
django-tables2~=2.3.1
|
django-tables2~=2.3.1
|
||||||
|
python-memcache~=1.59
|
||||||
phonenumbers~=8.9.10
|
phonenumbers~=8.9.10
|
||||||
Pillow>=5.4.1
|
Pillow>=5.4.1
|
||||||
|
|
Loading…
Reference in New Issue