#python
from flask import Flask,render_template,request
app = Flask(__name__)
@
app.route('/')
def index():
return render_template('index.html')
@
app.route('/')
def User_Agent():
UserAgentString = request.headers.get('User-Agent')
return render_template('index.html', UserAgentString=UserAgentString)
if __name__ == '__main__':
app.run(debug=True)
#HTML
<!DOCTYPE html>
<html lang="en">
<head>
<title>Cololi's blog</title>
<link href="/static/css/bootstrap.min.css" rel="stylesheet">
<link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
</head>
<body background="/static/BGP.jpg">
<ul><li><strong>User-Agent: </strong>{{ User_AgentString }}</li></ul>
</body>
</html>