home · contact · privacy
Add start / virtualenv helpers.
authorChristian Heller <c.heller@plomlompom.de>
Thu, 26 Jan 2017 00:02:41 +0000 (01:02 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Thu, 26 Jan 2017 00:02:41 +0000 (01:02 +0100)
requirements.txt [new file with mode: 0644]
run.sh [new file with mode: 0755]
url_catcher.py [changed mode: 0644->0755]

diff --git a/requirements.txt b/requirements.txt
new file mode 100644 (file)
index 0000000..114dbd4
--- /dev/null
@@ -0,0 +1,2 @@
+bottle==0.12.13
+validators==0.11.2
diff --git a/run.sh b/run.sh
new file mode 100755 (executable)
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 
old mode 100644 (file)
new mode 100755 (executable)
index ac4b7a7..ca0974f
@@ -1,3 +1,5 @@
+#!/usr/bin/python3
+
 import bottle
 import validators
 import html