diff --git a/main.wsgi b/main.wsgi new file mode 100644 index 0000000..7127181 --- /dev/null +++ b/main.wsgi @@ -0,0 +1,17 @@ +# coding: utf-8 + +import os.path, sys +sys.path.insert(0, '/path/to/the/supysonic/app') + +import config +if not config.check(): + sys.exit(1) + +if not os.path.exists(config.get('CACHE_DIR')): + os.makedirs(config.get('CACHE_DIR')) + +import db +db.init_db() + +from web import app as application + diff --git a/web.py b/web.py index 4219cb0..4432d23 100755 --- a/web.py +++ b/web.py @@ -28,7 +28,7 @@ def init_and_login_check(): if should_login: flash('Please login') - return redirect(url_for('login', returnUrl = request.url[len(request.url_root)-1:])) + return redirect(url_for('login', returnUrl = request.script_root + request.url[len(request.url_root)-1:])) @app.teardown_request def teardown(exception):