Direct deployment of flash on server
import logging
from flask import Flask, render_template, request
# Initialize the Flask application
app = Flask(__name__)
# Default route, print user's IP
@app.route('/')
def index():
ip = request.remote_addr
logging.debug(ip)
return render_template('index.html', user_ip=ip)
if __name__ == '__main__':
app.run(host="0.0.0.0", port=80)
Nginx agent in docker and flash in gunicorn
In this case, according to the above code can only get to the server address. You need to use werkzeug.middleware.proxy_ fix
import logging
from flask import Flask, render_template, request
from werkzeug.middleware.proxy_fix import ProxyFix
# Initialize the Flask application
app = Flask(__name__)
app.wsgi_app = ProxyFix(app.wsgi_app, num_proxies=1)
# Default route, print user's IP
@app.route('/')
def index():
ip = request.remote_addr
logging.debug(ip)
return render_template('index.html', user_ip=ip)
What can I do if I find IP
Flag gets the user’s IP, queries the user’s login times, and seals the IP
Read More:
- Flash + Vue uses Axios to obtain server data, and reports error: “request aborted”
- Several ways to check the IP address of raspberry pie
- [resolved] superset failed to create admin user: error! User already exists user or attributeerror: ‘nonetype’‘
- MS SQL Could not obtain information about Windows NT group/user ‘domain\login’, error code 0x5. [SQ…
- View the IP address of the docker container
- Raspberry pie view IP address (command ifconfig) and exit Ping
- IP address cannot be viewed through ifconfig in virtual machine
- Flask Request an extension before_request after_request errorhandler
- VirtualBox + CentOS 7 virtual machine setting static IP address of host only NIC
- How to solve oserror: [errno 98] address already in use and kill the python3 process
- Summary of solutions to open flash back problem after Python packaging
- Springboot project: error parsing HTTP request header note: further occurrences of HTTP request parsing
- Solve the flash card problem of winfrom project form
- Add samba user prompt Failed to add entry for user.
- Flash back problem of Python running
- Python uses requests to request and reports SSL: CERTIFICATE_VERIFY_FAILED error
- python sqlite Error IntegrityError: UNIQUE constraint failed: table_area1.user_name
- Add Samba user prompt failed to add entry for user
- User CF itemcf collaborative filtering algorithm based on user and item
- Failed to obtain JDBC Connection