Skip to content

Commit a35fd7f

Browse files
committed
att
1 parent 5eefeb9 commit a35fd7f

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

app.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
count = redis_client.get('count')
16+
return render_template('index.html', count=count)
17+
18+
if __name__ == '__main__':
19+
app.run(debug=True)

templates/index.html

Whitespace-only changes.

0 commit comments

Comments
 (0)