Ubuntu Pastebin

Paste from gautam at Sat, 5 Nov 2016 13:00:53 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import flask
from flask import request
import os

app = flask.Flask(__name__)

@app.route("/")
def Index():
    os.system("docker run -itd --name test ubuntu")
    os.system("sudo service redis_6379 stop")
    return "Welcome to the apache http web server. Your docker container has started"

@app.route("/some/<string:values>")
def some(values=None):
    return "The message sent is :  " + values

@app.errorhandler(500)
def ErHandle(e):
    return "This is the error handler function."


if __name__ == "__main__":
    app.run(host="0.0.0.0", port=9398, debug=True)
Download as text