diff --git a/paste.py b/paste.py index c128aa8..7152054 100644 --- a/paste.py +++ b/paste.py @@ -1,6 +1,6 @@ -#!/usr/bin/python3 +#!/usr/bin/python3.6 -from flask import Flask, request +from flask import Flask, request, render_template import random, string from pathlib import Path from pprint import pprint @@ -52,7 +52,7 @@ doesDirExist() # https://paste.benjamyn.love/CBynvvjwDK app = Flask(__name__) -app.config['DEBUG'] = True +app.config['DEBUG'] = False @app.route('/', methods=['POST', 'GET']) def index(): @@ -60,7 +60,7 @@ def index(): if allowListing == True: return "FileList" else: - return "Nothing to see here ;)" + return render_template("post.html") elif request.method == "POST": data = request.get_data().decode() if "Submit+Query" in data: @@ -82,7 +82,7 @@ def getPaste(path): if pasten.is_file(): with pasten.open() as f: data = f.read() print(data) - return data + return render_template("read.html", data=data) else: return "No paste found" diff --git a/templates/post.html b/templates/post.html new file mode 100644 index 0000000..ab34647 --- /dev/null +++ b/templates/post.html @@ -0,0 +1,27 @@ + + +
+