-
-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Db selection for Redis cache urls
- Loading branch information
Showing
3 changed files
with
7 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,7 +63,7 @@ This is your `settings.py` file before you have installed **django-environ** | |
}, | ||
'redis': { | ||
'BACKEND': 'django_redis.cache.RedisCache', | ||
'LOCATION': '127.0.0.1:6379:1', | ||
'LOCATION': '127.0.0.1:6379/1', | ||
'OPTIONS': { | ||
'CLIENT_CLASS': 'django_redis.client.DefaultClient', | ||
'PASSWORD': 'redis-githubbed-password', | ||
|
@@ -116,7 +116,7 @@ Create a ``.env`` file: | |
DATABASE_URL=psql://urser:[email protected]:8458/database | ||
# SQLITE_URL=sqlite:///my-local-sqlite.db | ||
CACHE_URL=memcache://127.0.0.1:11211,127.0.0.1:11212,127.0.0.1:11213 | ||
REDIS_URL=rediscache://127.0.0.1:6379:1?client_class=django_redis.client.DefaultClient&password=redis-un-githubbed-password | ||
REDIS_URL=rediscache://127.0.0.1:6379/1?client_class=django_redis.client.DefaultClient&password=redis-un-githubbed-password | ||
How to install | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ class BaseTests(unittest.TestCase): | |
ORACLE_TNS = 'oracle://user:password@sid/' | ||
ORACLE = 'oracle://user:password@host:1521/sid' | ||
MEMCACHE = 'memcache://127.0.0.1:11211' | ||
REDIS = 'rediscache://127.0.0.1:6379:1?client_class=django_redis.client.DefaultClient&password=secret' | ||
REDIS = 'rediscache://127.0.0.1:6379/1?client_class=django_redis.client.DefaultClient&password=secret' | ||
EMAIL = 'smtps://[email protected]:[email protected]:587' | ||
JSON = dict(one='bar', two=2, three=33.44) | ||
DICT = dict(foo='bar', test='on') | ||
|
@@ -208,7 +208,7 @@ def test_cache_url_value(self): | |
|
||
redis_config = self.env.cache_url('CACHE_REDIS') | ||
self.assertEqual(redis_config['BACKEND'], 'django_redis.cache.RedisCache') | ||
self.assertEqual(redis_config['LOCATION'], 'redis://127.0.0.1:6379:1') | ||
self.assertEqual(redis_config['LOCATION'], 'redis://127.0.0.1:6379/1') | ||
self.assertEqual(redis_config['OPTIONS'], { | ||
'CLIENT_CLASS': 'django_redis.client.DefaultClient', | ||
'PASSWORD': 'secret', | ||
|
@@ -439,11 +439,11 @@ def test_dummycache_parsing(self): | |
self.assertEqual(url['LOCATION'], '') | ||
|
||
def test_redis_parsing(self): | ||
url = 'rediscache://127.0.0.1:6379:1?client_class=django_redis.client.DefaultClient&password=secret' | ||
url = 'rediscache://127.0.0.1:6379/1?client_class=django_redis.client.DefaultClient&password=secret' | ||
url = Env.cache_url_config(url) | ||
|
||
self.assertEqual(url['BACKEND'], REDIS_DRIVER) | ||
self.assertEqual(url['LOCATION'], 'redis://127.0.0.1:6379:1') | ||
self.assertEqual(url['LOCATION'], 'redis://127.0.0.1:6379/1') | ||
self.assertEqual(url['OPTIONS'], { | ||
'CLIENT_CLASS': 'django_redis.client.DefaultClient', | ||
'PASSWORD': 'secret', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ BOOL_FALSE_VAR2=False | |
DATABASE_MYSQL_URL=mysql://bea6eb0:[email protected]/heroku_97681?reconnect=true | ||
DATABASE_MYSQL_GIS_URL=mysqlgis://user:[email protected]/some_database | ||
CACHE_URL=memcache://127.0.0.1:11211 | ||
CACHE_REDIS=rediscache://127.0.0.1:6379:1?client_class=django_redis.client.DefaultClient&password=secret | ||
CACHE_REDIS=rediscache://127.0.0.1:6379/1?client_class=django_redis.client.DefaultClient&password=secret | ||
EMAIL_URL=smtps://[email protected]:[email protected]:587 | ||
URL_VAR=http://www.google.com/ | ||
PATH_VAR=/home/dev | ||
|