From d56dcab5d48c8c4ec05f200f92bd35a1f977cd4f Mon Sep 17 00:00:00 2001 From: RaNaN Date: Wed, 6 Jan 2010 17:38:53 +0100 Subject: cli fix, webinterface db check --- module/web/ServerThread.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'module/web/ServerThread.py') 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': -- cgit v1.2.3