Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/axil/redissentry-core
https://github.com/axil/redissentry-core
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/axil/redissentry-core
- Owner: axil
- License: mit
- Created: 2012-04-09T19:37:38.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2012-06-25T11:21:34.000Z (over 12 years ago)
- Last Synced: 2024-11-11T06:41:35.506Z (2 months ago)
- Language: Python
- Homepage:
- Size: 103 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGES
- License: LICENSE
Awesome Lists containing this project
README
===========
RedisSentry
===========This is generic RedisSentry documentaion, for django specific notes,
see django-redissentry docs.Installation
------------This is how RedisSentry can be integrated into any python-powered project (eg Flask):
::
from redissentry import RedisSentry
def protected_auth(username, password):
sentry = RedisSentry(ip, username)
msg = sentry.ask()
if msg:
raise Exception(msg)
res = auth(username, password)
msg = sentry.inform(bool(res))
if not res:
raise Exception('Incorrect username or password. ' + msg)
return reswhere auth() is the original auth function.