Skip to content

Commit

Permalink
Setup file finalized, documentation and history implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
rhyselsmore committed Jul 5, 2013
1 parent 03fd707 commit 11b8872
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 91 deletions.
4 changes: 0 additions & 4 deletions HISTORY.md

This file was deleted.

8 changes: 8 additions & 0 deletions HISTORY.rst
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.
80 changes: 0 additions & 80 deletions README.md

This file was deleted.

86 changes: 86 additions & 0 deletions README.rst
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.
27 changes: 20 additions & 7 deletions setup.py
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',
Expand All @@ -28,4 +41,4 @@
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
'Topic :: Software Development :: Libraries :: Python Modules'
]
)
)
Empty file removed test_flask_redis.py
Empty file.

0 comments on commit 11b8872

Please sign in to comment.