diff --git a/Readme.md b/Readme.md index 8c9d66a..f606be6 100644 --- a/Readme.md +++ b/Readme.md @@ -14,4 +14,4 @@ It is written as a replacement for the gorgeous sprunge.us . bin/activate cd bump - python init.py + gunicorn -b 127.0.0.1:4000 init:app diff --git a/bump/init.py b/bump/init.py index ff7fea4..bfdaa10 100644 --- a/bump/init.py +++ b/bump/init.py @@ -1,11 +1,10 @@ from flask import Flask, Response, request, send_from_directory from functools import wraps -import sys import random import string import os app = Flask(__name__) -storedir = os.path.join(app.root_path, 'store'), +storedir = os.path.join(app.root_path, 'store') app.config['storedir'] = storedir @@ -25,10 +24,13 @@ def usage(host): < balls Source at http://github.com/makefu/bump""".format(host) + @app.route('/favicon.ico') def favicon(): return send_from_directory(os.path.join(app.root_path, 'static'), - 'favicon.ico', mimetype='image/vnd.microsoft.icon') + 'favicon.ico', + mimetype='image/vnd.microsoft.icon') + @returns_plain @app.route("/", methods=["GET"]) @@ -63,11 +65,11 @@ def retrieve_file(key): def store(key, value): with open("%s/%s" % (storedir, key), "wb+") as f: try: - # py3 - f.write(bytes(value, "UTF-8")) + # py3 + f.write(bytes(value, "UTF-8")) except: - # py2 - f.write(value) + # py2 + f.write(value) def retrieve(key): diff --git a/deps.txt b/deps.txt index cfb3ba9..2e23110 100644 --- a/deps.txt +++ b/deps.txt @@ -3,4 +3,5 @@ Jinja2==2.7.1 MarkupSafe==0.18 Werkzeug==0.9.4 distribute==0.6.31 +gunicorn==18.0 itsdangerous==0.23