Debian Codegraph @

PKG-INFO

raw
1 Metadata-Version: 1.1
2 Name: django-redis-sessions
3 Version: 0.6.2
4 Summary: Redis Session Backend For Django
5 Home-page: http://github.com/martinrusev/django-redis-sessions
6 Author: Martin Rusev
7 Author-email: [email protected]
8 License: BSD
9 Description: django-redis-sessions
10 =====================
11
12 Redis database backend for your sessions
13
14 |Build Status|
15
16 - `Installation`_
17 - `Available Settings`_
18 - `Changelog`_
19
20 Installation
21 ============
22
23 - Run ``pip install django-redis-sessions`` or alternatively download
24 the tarball and run ``python setup.py install``,
25
26 For Django < 1.4 run ``pip install django-redis-sessions==0.3``
27
28 - Set ``redis_sessions.session`` as your session engine, like so:
29
30 .. code:: python
31
32 SESSION_ENGINE = 'redis_sessions.session'
33
34 Available Settings
35 ==================
36
37 .. code:: python
38
39 SESSION_REDIS = {
40 'host': 'localhost',
41 'port': 6379,
42 'db': 0,
43 'password': 'password',
44 'prefix': 'session',
45 'socket_timeout': 1,
46 'retry_on_timeout': False
47 }
48
49 If you prefer domain socket connection, you can just add this line
50 instead of HOST and PORT.
51
52 .. code:: python
53
54 SESSION_REDIS = {
55 'unix_domain_socket_path': '/var/run/redis/redis.sock',
56 'db': 0,
57 'password': 'password',
58 'prefix': 'session',
59 'socket_timeout': 1,
60 'retry_on_timeout': False
61 }
62
63 Redis Sentinel
64 ~~~~~~~~~~~~~~
65
66 .. code:: python
67
68 SESSION_REDIS_SENTINEL_LIST = [(host, port), (host, port), (host, port)]
69 SESSION_REDIS_SENTINEL_MASTER_ALIAS = 'sentinel-master'
70
71 Redis Pool (Horizontal partitioning)
72 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
73
74 Splits sessions between Redis instances based on the session key. You
75 can configure the connection type for each Redis instance in the pool
76 (host/port, unix socket, redis url).
77
78
79 .. code:: python
80
81 SESSION_REDIS = {
82 'prefix': 'session',
83 'socket_timeout': 1
84 'retry_on_timeout': False,
85 'pool': [{
86 'host': 'localhost3',
87 'port': 6379,
88 'db': 0,
89 'password': None,
90 'unix_domain_socket_path': None,
91 'url': None,
92 'weight': 1
93 },
94 {
95 'host': 'localhost2',
96 'port': 6379,
97 'db': 0,
98 'password': None,
99 'unix_domain_socket_path': None,
100 'url': None,
101 'weight': 1
102 },
103 {
104 'host': 'localhost1',
105 'port': 6379,
106 'db': 0,
107 'password': None,
108 'unix_domain_socket_path': None,
109 'url': None,
110 'weight': 1
111 }]
112 }
113
114
115 Tests
116 =====
117
118 .. code:: bash
119
120 $ pip install -r dev_requirements.txt
121 # Make sure you have redis running on localhost:6379
122 $ nosetests -v
123
124 `Changelog <https://github.com/martinrusev/django-redis-sessions/blob/master/CHANGELOG.md>`__
125 =============================================================================================
126
127 .. _Installation: #installation
128 .. _Available Settings: #available-settings
129 .. _Changelog: #changelog
130
131 .. |Build Status| image:: https://travis-ci.org/martinrusev/django-redis-sessions.svg?branch=master
132 :target: https://travis-ci.org/martinrusev/django-redis-sessions
133
134 Keywords: django,sessions,
135 Platform: UNKNOWN
136 Classifier: Programming Language :: Python :: 2
137 Classifier: Programming Language :: Python :: 3
138 Classifier: Topic :: Software Development :: Libraries :: Python Modules
139 Classifier: Framework :: Django
140 Classifier: Environment :: Web Environment