Dooratre commited on
Commit
6f3cdc4
1 Parent(s): c3efb51

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -11
app.py CHANGED
@@ -1,14 +1,20 @@
1
- from flask import Flask, request
2
- import geocoder
3
 
4
- app = Flask(__name__)
5
 
6
- @app.route('/')
7
- def index():
8
- user_ip = request.remote_addr
9
- location = geocoder.ip(user_ip).city
10
- # Do something with the user's location
11
- return f"Your location is: {location}"
12
 
13
- if __name__ == '__main__':
14
- app.run(host='0.0.0.0',port= 7860)
 
 
 
 
 
 
 
 
 
 
 
1
+ import requests
2
+ import urllib3
3
 
4
+ api_url = "https://ai-app-ly.infinityfreeapp.com"
5
 
6
+ # Disable SSL certificate verification
7
+ urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
 
 
 
 
8
 
9
+
10
+ data = {
11
+ "register": True,
12
+ "username": "rth",
13
+ "password": "gkfgfgh"
14
+ }
15
+
16
+ response = requests.post(api_url, data=data, verify=False)
17
+ json_data = response.json()
18
+ message = json_data['message']
19
+
20
+ print(message)