import socket hostname = socket.gethostname() ip = socket.gethostbyname(hostname)
from flask import request def get_ip(): ip = request.remote_addr return ip