We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5eefeb9 commit a35fd7fCopy full SHA for a35fd7f
app.py
@@ -0,0 +1,19 @@
1
+from flask import Flask, render_template
2
+import redis
3
+
4
+app = Flask(__name__)
5
+redis_client = redis.Redis(host='localhost', port=6379)
6
7
+@app.route('/')
8
+def index():
9
+ count = redis_client.get('count')
10
+ return render_template('index.html', count=count)
11
12
+@app.route('/update')
13
+def update():
14
+ redis_client.incr('count')
15
16
17
18
+if __name__ == '__main__':
19
+ app.run(debug=True)
templates/index.html
0 commit comments