Skip to content

Instantly share code, notes, and snippets.

Created March 26, 2013 04:56
What would you like to do?
Flask Server
from flask import Flask, request
import socket
from Pypi import Installer
app = Flask(__name__)
def index():
return 'Hello World!'
def install():
package = request.args.get('package', '')
version = request.args.get('version', '')
i = Installer(package, version)
return 'Successfully installed ' + package
# Attempt at getting this device's ip address
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(('', 9))
print 'My IP: ' + s.getsockname()[0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment