summaryrefslogtreecommitdiffstats
path: root/module/web/ServerThread.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-01-06 17:38:53 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-01-06 17:38:53 +0100
commitd56dcab5d48c8c4ec05f200f92bd35a1f977cd4f (patch)
tree6bc154635899269fddec8f8137476fd432a3edac /module/web/ServerThread.py
parentwebinterface fix (diff)
downloadpyload-d56dcab5d48c8c4ec05f200f92bd35a1f977cd4f.tar.xz
cli fix, webinterface db check
Diffstat (limited to 'module/web/ServerThread.py')
-rw-r--r--module/web/ServerThread.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/module/web/ServerThread.py b/module/web/ServerThread.py
index 069cabafe..8be3892b5 100644
--- a/module/web/ServerThread.py
+++ b/module/web/ServerThread.py
@@ -2,6 +2,7 @@
from __future__ import with_statement
import threading
from os.path import join
+from os.path import exists
from subprocess import Popen, PIPE, STDOUT
from time import sleep
from signal import SIGINT
@@ -18,6 +19,16 @@ class WebServer(threading.Thread):
host = self.pycore.config['webinterface']['host']
port = self.pycore.config['webinterface']['port']
command = ['python',join(self.pycore.path,"module","web","manage.py"), "runserver", "%s:%s" % (host,port)]
+
+ if not exists(join(self.pycore.path,"module","web","pyload.db")):
+ print "########## IMPORTANT ###########"
+ print "### Database for Webinterface doesnt exitst, it will not be available."
+ print "### Please run: python %s syncdb" % join(self.pycore.path,"module","web","manage.py")
+ print "### You have to add at least one User, to gain access to webinterface: python %s createsuperuser" % join(self.pycore.path,"module","web","manage.py")
+ print "### Dont forget to restart pyLoad if you are done."
+ print "################################"
+ raise Exception, "Database doesnt exists, please use syncdb"
+
self.pycore.logger.info("Starting Webserver: %s:%s" % (host,port) )
if os.name == 'posix':