From: Christian Heller Date: Thu, 26 Jan 2017 00:02:41 +0000 (+0100) Subject: Add start / virtualenv helpers. X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/balance?a=commitdiff_plain;h=50dac05d76e36020536ac7c75325f54d1caba3dd;p=url-catcher Add start / virtualenv helpers. --- diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..114dbd4 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +bottle==0.12.13 +validators==0.11.2 diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..5fe6132 --- /dev/null +++ b/run.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# This script runs the url-catcher in a virtual environment with temporarily +# installed required external Python libraries. +set -e + +DIR_ENV=.temp_env + +pyvenv $DIR_ENV +source $DIR_ENV/bin/activate +pip install -r requirements.txt +echo +set +e +uwsgi --socket 127.0.0.1:3031 --wsgi-file url_catcher.py +set -e +deactivate +rm -rf $DIR_ENV diff --git a/url_catcher.py b/url_catcher.py old mode 100644 new mode 100755 index ac4b7a7..ca0974f --- a/url_catcher.py +++ b/url_catcher.py @@ -1,3 +1,5 @@ +#!/usr/bin/python3 + import bottle import validators import html