Arrcttacsrks commited on
Commit
ee99924
1 Parent(s): 7a36c10

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -10
app.py CHANGED
@@ -1,10 +1,11 @@
1
- from flask import Flask, render_template
2
-
3
- app = Flask(__name__)
4
-
5
- @app.route('/')
6
- def index():
7
- return render_template('index.html')
8
-
9
- if __name__ == '__main__':
10
- app.run(debug=True)
 
 
1
+ from flask import Flask, render_template, request
2
+
3
+ app = Flask(__name__)
4
+
5
+ @app.route('/')
6
+ def index():
7
+ user_ip = request.remote_addr # Lấy địa chỉ IP của người dùng
8
+ return render_template('index.html', user_ip=user_ip)
9
+
10
+ if __name__ == '__main__':
11
+ app.run(debug=True)