-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
47 lines (39 loc) · 1.28 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from flask import Flask, render_template, request
app = Flask(__name__)
@app.route("/")
def home():
user_agent = request.headers.get('User-Agent')
user_agent = user_agent.lower()
if "iphone" in user_agent:
return render_template('mobile.html')
elif "android" in user_agent:
return render_template('mobile.html')
elif "ipad" in user_agent:
return render_template('mobile.html')
else:
return render_template("home.html")
@app.route("/about")
def about():
user_agent = request.headers.get('User-Agent')
user_agent = user_agent.lower()
if "iphone" in user_agent:
return render_template('mobile.html')
elif "android" in user_agent:
return render_template('mobile.html')
elif "ipad" in user_agent:
return render_template('mobile.html')
else:
return render_template("about.html")
@app.route("/play")
def play():
user_agent = request.headers.get('User-Agent')
user_agent = user_agent.lower()
if "iphone" in user_agent:
return render_template('mobile.html')
elif "android" in user_agent:
return render_template('mobile.html')
elif "ipad" in user_agent:
return render_template('mobile.html')
else:
return render_template("play.html")
app.run()