summaryrefslogtreecommitdiff
path: root/mediabrowser/wsgi.py
diff options
context:
space:
mode:
Diffstat (limited to 'mediabrowser/wsgi.py')
-rw-r--r--mediabrowser/wsgi.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/mediabrowser/wsgi.py b/mediabrowser/wsgi.py
new file mode 100644
index 0000000..7d80852
--- /dev/null
+++ b/mediabrowser/wsgi.py
@@ -0,0 +1,15 @@
+from flask import Flask
+from werkzeug.contrib.cache import SimpleCache
+
+import mediabrowser
+
+import os
+
+
+"""Run via WSGI"""
+root = os.getenv("MEDIABROWSER_ROOT")
+if not root:
+ raise Exception('Must set MEDIABROWSER_ROOT variable')
+cache = SimpleCache()
+application = Flask("mediabrowser-demo")
+application.register_blueprint(mediabrowser.build(root, cache))