[Backport] Add django-redis
parent
bcb8f4d0ed
commit
d656458372
|
@ -4,6 +4,7 @@ python:
|
|||
- "3.5"
|
||||
services:
|
||||
- rabbitmq # will start rabbitmq-server
|
||||
- redis-server
|
||||
cache:
|
||||
- apt
|
||||
- pip
|
||||
|
|
|
@ -11,6 +11,7 @@ amqp==1.4.7
|
|||
djmail==0.11
|
||||
django-pgjson==0.3.1
|
||||
djorm-pgarray==1.2
|
||||
django-redis==4.3.0
|
||||
django-jinja==2.1.1
|
||||
jinja2==2.8
|
||||
pygments==2.0.2
|
||||
|
|
|
@ -35,6 +35,7 @@ DATABASES = {
|
|||
}
|
||||
}
|
||||
|
||||
# Default cache (you can use redis cache, see settings/locale.py.example)
|
||||
CACHES = {
|
||||
"default": {
|
||||
"BACKEND": "django.core.cache.backends.locmem.LocMemCache",
|
||||
|
@ -42,6 +43,7 @@ CACHES = {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
PASSWORD_HASHERS = [
|
||||
"django.contrib.auth.hashers.PBKDF2PasswordHasher",
|
||||
]
|
||||
|
|
|
@ -33,6 +33,17 @@ DATABASES = {
|
|||
}
|
||||
}
|
||||
|
||||
# You can use redis cache
|
||||
#CACHES = {
|
||||
# "default": {
|
||||
# "BACKEND": "django_redis.cache.RedisCache",
|
||||
# "LOCATION": "'redis://localhost:6379/1",
|
||||
# "OPTIONS": {
|
||||
# "CLIENT_CLASS": "django_redis.client.DefaultClient",
|
||||
# }
|
||||
# }
|
||||
#}
|
||||
|
||||
#SITES = {
|
||||
# "api": {
|
||||
# "scheme": "http",
|
||||
|
|
|
@ -17,6 +17,16 @@
|
|||
|
||||
from .development import *
|
||||
|
||||
CACHES = {
|
||||
"default": {
|
||||
"BACKEND": "django_redis.cache.RedisCache",
|
||||
"LOCATION": "'redis://localhost:6379/1",
|
||||
"OPTIONS": {
|
||||
"CLIENT_CLASS": "django_redis.client.DefaultClient",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SKIP_SOUTH_TESTS = True
|
||||
SOUTH_TESTS_MIGRATE = False
|
||||
CELERY_ALWAYS_EAGER = True
|
||||
|
|
|
@ -24,3 +24,13 @@ DATABASES = {
|
|||
'USERNAME': 'postgres',
|
||||
}
|
||||
}
|
||||
|
||||
CACHES = {
|
||||
"default": {
|
||||
"BACKEND": "django_redis.cache.RedisCache",
|
||||
"LOCATION": "'redis://localhost:6379/1",
|
||||
"OPTIONS": {
|
||||
"CLIENT_CLASS": "django_redis.client.DefaultClient",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue