Fixed for WSGI

This commit is contained in:
Benjamyn Love 2019-02-20 21:20:13 +11:00
parent 6912c95de3
commit 3d1a2ff9a1
3 changed files with 10 additions and 5 deletions

View File

@ -56,10 +56,10 @@ doesDirExist()
# https://paste.benjamyn.love/CBynvvjwDK
app = Flask(__name__)
app.config['DEBUG'] = False
application = Flask(__name__)
application.config['DEBUG'] = False
@app.route('/', methods=['POST', 'GET'])
@application.route('/', methods=['POST', 'GET'])
def index():
printRealIP()
if request.method == "GET":
@ -80,7 +80,7 @@ def index():
return method + hostedURL + name
@app.route('/<path:path>')
@application.route('/<path:path>')
def getPaste(path):
printRealIP()
raw = False
@ -104,4 +104,4 @@ def getPaste(path):
return render_template("read.html", data="No paste found")
if __name__ == '__main__':
app.run(host='127.0.0.1')
application.run(host='127.0.0.1')

1
templates/fuck.html Normal file
View File

@ -0,0 +1 @@
<pre>{{data|escape}}</pre>

4
wsgi.py Normal file
View File

@ -0,0 +1,4 @@
from paste import application
if "__main__" == __name__:
application.run()