diff --git a/README.md b/README.md index e0e9e92..5fbd6c9 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,6 @@ class uploadr: # gunicorn bind = "0.0.0.0:" + uploadr.port ``` - -You also need to create the directories `qrcodes` and `uploads` (in your working directory). ## dependencies uploadr uses the following modules: - `flask` diff --git a/uploadr.py b/uploadr.py index f9deaab..db783bf 100644 --- a/uploadr.py +++ b/uploadr.py @@ -11,6 +11,12 @@ from werkzeug.utils import secure_filename app = Flask(__name__) app.config['SECRET_KEY'] = os.urandom(24) +if not os.path.isdir(config.uploads): + os.makedirs(config.uploads) + +if not os.path.isdir(config.qrcodes): + os.makedirs(config.qrcodes) + @app.route("/") @app.route('/upload', methods=['GET','POST']) def upload_file():