Skip to content

Instantly share code, notes, and snippets.

@chadgh
Created March 13, 2015 22:09
Show Gist options
  • Save chadgh/b9debd2f00b6d3d353bf to your computer and use it in GitHub Desktop.
Save chadgh/b9debd2f00b6d3d353bf to your computer and use it in GitHub Desktop.
from flask import Flask, request
app = Flask(__name__)
app.debug = False
@app.route('/')
def get_ip_address():
style = """
<style>
body { text-align: center; font-size: 8em; color: rgb(176, 204, 105); font-family: Courier; letter-spacing:-0.05em; margin-top: 25px; font-weight: bold; background: rgb(58, 58, 58); }
</style>
"""
return " ".join([style, str(request.remote_addr)])
@app.route('/plain')
def get_ip_plain():
return str(request.remote_addr)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment