From ae96b0c268dbc4e1032319a1e1bb674bd0081b15 Mon Sep 17 00:00:00 2001 From: sqozz Date: Wed, 10 Feb 2016 23:30:52 +0100 Subject: [PATCH] Added wsgi script --- schort.py | 2 +- schort.wsgi | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100755 schort.wsgi diff --git a/schort.py b/schort.py index 1d5e283..4fe1241 100755 --- a/schort.py +++ b/schort.py @@ -28,7 +28,7 @@ def short(shortLink=""): def insertIdUnique(idToCheck, longUrl): hashUrl = hashlib.sha256(longUrl.encode()).digest() - base64Url = base64.b64encode(hashUrl).decode() + base64Url = base64.urlsafe_b64encode(hashUrl).decode() if len(idToCheck) == 0: idToCheck = base64Url[:4] diff --git a/schort.wsgi b/schort.wsgi new file mode 100755 index 0000000..6392ba4 --- /dev/null +++ b/schort.wsgi @@ -0,0 +1,4 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +import schort +application = schort.app.wsgi_app