Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
JuniorJPDJ
funkwhale
Commits
6172c0be
Commit
6172c0be
authored
Jul 09, 2017
by
Eliot Berriot
Browse files
upgrade to latest dynamic_preferences and use redis as cache even locally
parent
897d417a
Changes
4
Hide whitespace changes
Inline
Side-by-side
api/config/settings/common.py
View file @
6172c0be
...
...
@@ -260,6 +260,18 @@ BROKER_URL = env("CELERY_BROKER_URL", default='django://')
########## END CELERY
CACHES
=
{
"default"
:
{
"BACKEND"
:
"django_redis.cache.RedisCache"
,
"LOCATION"
:
"{0}/{1}"
.
format
(
env
.
cache_url
(
'REDIS_URL'
,
default
=
"redis://127.0.0.1:6379"
),
0
),
"OPTIONS"
:
{
"CLIENT_CLASS"
:
"django_redis.client.DefaultClient"
,
"IGNORE_EXCEPTIONS"
:
True
,
# mimics memcache behavior.
# http://niwinz.github.io/django-redis/latest/#_memcached_exceptions_behavior
}
}
}
# Location of root django.contrib.admin URL, use {% url 'admin:index' %}
ADMIN_URL
=
r
'^admin/'
# Your common stuff: Below this line define 3rd party library settings
...
...
api/config/settings/local.py
View file @
6172c0be
...
...
@@ -28,14 +28,6 @@ EMAIL_PORT = 1025
EMAIL_BACKEND
=
env
(
'DJANGO_EMAIL_BACKEND'
,
default
=
'django.core.mail.backends.console.EmailBackend'
)
# CACHING
# ------------------------------------------------------------------------------
CACHES
=
{
'default'
:
{
'BACKEND'
:
'django.core.cache.backends.locmem.LocMemCache'
,
'LOCATION'
:
''
}
}
# django-debug-toolbar
# ------------------------------------------------------------------------------
...
...
api/config/settings/production.py
View file @
6172c0be
...
...
@@ -100,17 +100,7 @@ DATABASES['default'] = env.db("DATABASE_URL")
# CACHING
# ------------------------------------------------------------------------------
# Heroku URL does not pass the DB number, so we parse it in
CACHES
=
{
"default"
:
{
"BACKEND"
:
"django_redis.cache.RedisCache"
,
"LOCATION"
:
"{0}/{1}"
.
format
(
env
.
cache_url
(
'REDIS_URL'
,
default
=
"redis://127.0.0.1:6379"
),
0
),
"OPTIONS"
:
{
"CLIENT_CLASS"
:
"django_redis.client.DefaultClient"
,
"IGNORE_EXCEPTIONS"
:
True
,
# mimics memcache behavior.
# http://niwinz.github.io/django-redis/latest/#_memcached_exceptions_behavior
}
}
}
# LOGGING CONFIGURATION
...
...
api/requirements/base.txt
View file @
6172c0be
...
...
@@ -55,4 +55,4 @@ mutagen==1.38
# Until this is merged
git+https://github.com/EliotBerriot/PyMemoize.git@django
django-dynamic-preferences>=1.
2
,<1.
3
django-dynamic-preferences>=1.
3
,<1.
4
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment