-
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup file finalized, documentation and history implemented
- Loading branch information
1 parent
03fd707
commit 11b8872
Showing
6 changed files
with
114 additions
and
91 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
History | ||
======= | ||
|
||
0.0.1 (5/7/2013) | ||
---------------- | ||
|
||
- Conception | ||
- Initial Commit of Package to GitHub. |
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 |
---|---|---|
@@ -0,0 +1,86 @@ | ||
Flask-Redis | ||
=========== | ||
|
||
Add Redis Support to Flask. | ||
|
||
Built on top of redis-py | ||
|
||
Currently a single namespace within the configuration is supported. | ||
|
||
.. code-block:: pycon | ||
REDIS_URL="redis://localhost" | ||
with the Redis instance automatically loading variables from this namespace. | ||
|
||
In the future, the ability to declare multiple Redis namespaces will be available | ||
|
||
.. code-block:: pycon | ||
REDIS_CACHE_URL="redis://localhost/0" | ||
REDIS_METRICS_URL="redis://localhost/0" | ||
redis_cache = Redis(config_prefix="REDIS_CACHE") | ||
redis_metrics = Redis(config_prefix="REDIS_METRICS") | ||
Installation | ||
------------ | ||
|
||
.. code-block:: bash | ||
pip install flask-redis | ||
Or if you *must* use easy_install: | ||
|
||
.. code-block:: bash | ||
alias easy_install="pip install $1" | ||
easy_install flask-redis | ||
Configuration | ||
------------- | ||
|
||
**ToDo** Add Settings | ||
|
||
.. code-block:: pycon | ||
from flask import Flask | ||
from flask_redis import Redis | ||
app = Flask(__name__) | ||
redis_store = Redis(app) | ||
or | ||
|
||
.. code-block:: pycon | ||
from flask import Flask | ||
from flask_redis import Redis | ||
redis_store = Redis() | ||
def create_app(): | ||
app = Flask(__name__) | ||
redis.init_app(app) | ||
return app | ||
Usage | ||
----- | ||
|
||
.. code-block:: pycon | ||
from core import redis_store | ||
@app.route('/') | ||
def index(): | ||
return redis_store.get('potato','Not Set') | ||
`redis-py <https://github.com/andymccurdy/redis-py>`_ | ||
|
||
**Protip:** The `redis-py <https://github.com/andymccurdy/redis-py>`_ package currently holds the 'redis' namespace, | ||
so if you are looking to make use of it, your Redis object shouldn't be named 'redis'. | ||
|
||
For detailed instructions regarding the usage of the client, check the `redis-py <https://github.com/andymccurdy/redis-py>`_ documentation. | ||
|
||
Advanced features, such as Lua scripting, pipelines and callbacks are detailed within the projects README. |
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 |
---|---|---|
@@ -1,24 +1,37 @@ | ||
from setuptools import setup | ||
#!/usr/bin/env python | ||
|
||
import os | ||
import sys | ||
|
||
try: | ||
from setuptools import setup | ||
except ImportError: | ||
from distutils.core import setup | ||
|
||
if sys.argv[-1] == 'publish': | ||
os.system('python setup.py sdist upload') | ||
sys.exit() | ||
|
||
|
||
setup( | ||
name='Flask-Redis', | ||
version='0.1', | ||
version='0.0.1', | ||
url='http://github.com/rhyselsmore/flask-redis', | ||
license='Apache2', | ||
author='Rhys Elsmore', | ||
author_email='[email protected]', | ||
description='Adds Redis support to your Flask application', | ||
long_description=__doc__, | ||
description='Redis Extension for Flask Applications', | ||
long_description=open('README.rst').read() + '\n\n' + | ||
open('HISTORY.rst').read(), | ||
py_modules=['flask_redis'], | ||
license=open('LICENSE').read(), | ||
package_data={'': ['LICENSE']}, | ||
zip_safe=False, | ||
platforms='any', | ||
install_requires=[ | ||
'setuptools', | ||
'Flask', | ||
'Redis' | ||
], | ||
test_suite='test_flask.suite', | ||
classifiers=[ | ||
'Development Status :: 4 - Beta', | ||
'Environment :: Web Environment', | ||
|
@@ -28,4 +41,4 @@ | |
'Topic :: Internet :: WWW/HTTP :: Dynamic Content', | ||
'Topic :: Software Development :: Libraries :: Python Modules' | ||
] | ||
) | ||
) |
Empty file.