Skip to content

Instantly share code, notes, and snippets.

@anoochit
Created November 26, 2014 15:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anoochit/6cc84288d4135fef2e5f to your computer and use it in GitHub Desktop.
Save anoochit/6cc84288d4135fef2e5f to your computer and use it in GitHub Desktop.
fig sample app.py
from flask import Flask
from redis import Redis
import os
app = Flask(__name__)
redis = Redis(host="redis_1", port=6379)
@app.route('/')
def hello():
redis.incr('hits')
return 'Hello World! I have been seen %s times.' % redis.get('hits')
if __name__ == "__main__":
app.run(host="0.0.0.0", debug=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment