Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
D
Django-Redis-Cache
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shared
Django-Redis-Cache
Commits
54ace502
Commit
54ace502
authored
Jan 04, 2011
by
Stephane Angel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
following updates in django 1.3 dev
parent
a77fcb9f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
README.rst
README.rst
+9
-1
cache.py
redis_cache/cache.py
+3
-3
No files found.
README.rst
View file @
54ace502
...
...
@@ -20,7 +20,15 @@ Usage
2. Modify your Django settings to use ``redis_cache`` ::
CACHE_BACKEND = 'redis_cache.cache://<host>:<port>'
CACHES = {
'default': {
'BACKEND': 'redis_cache.cache.CacheClass',
'LOCATION': '<host>:<port>',
'OPTIONS': { # optional
'DB': 1,
},
},
}
...
...
redis_cache/cache.py
View file @
54ace502
...
...
@@ -15,12 +15,12 @@ except ImportError:
class
CacheClass
(
BaseCache
):
def
__init__
(
self
,
server
,
params
,
key_prefix
=
''
,
version
=
1
,
key_func
=
None
):
def
__init__
(
self
,
server
,
params
):
"""
Connect to Redis, and set up cache backend.
"""
BaseCache
.
__init__
(
self
,
params
,
key_prefix
,
version
,
key_func
)
db
=
params
.
get
(
'db'
,
1
)
BaseCache
.
__init__
(
self
,
params
)
db
=
params
.
get
(
'
OPTIONS'
,
{})
.
get
(
'
db'
,
1
)
try
:
db
=
int
(
db
)
except
(
ValueError
,
TypeError
):
...
...
Write
Preview
Markdown
is supported
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