summaryrefslogtreecommitdiffstats
path: root/module/web/ServerThread.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2009-12-17 16:14:26 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2009-12-17 16:14:26 +0100
commit511ae48877f8f3fae2a3ba282d979c33f2ea5491 (patch)
tree946b97a81fa6a3efbc181177e805cee922305a47 /module/web/ServerThread.py
parentLittle Rapidshare Fix (diff)
downloadpyload-511ae48877f8f3fae2a3ba282d979c33f2ea5491.tar.xz
webinterface: config working, downloadable files
Diffstat (limited to 'module/web/ServerThread.py')
-rw-r--r--module/web/ServerThread.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/module/web/ServerThread.py b/module/web/ServerThread.py
index 803dc5dc5..790ac152b 100644
--- a/module/web/ServerThread.py
+++ b/module/web/ServerThread.py
@@ -2,6 +2,7 @@
import threading
import os
from os.path import join
+import subprocess
class WebServer(threading.Thread):
def __init__(self, pycore):
@@ -10,6 +11,12 @@ class WebServer(threading.Thread):
self.setDaemon(True)
def run(self):
- self.pycore.logger.info("Starting Webserver @ Port 8000")
- os.system("python " + join(self.pycore.path,"module","web","manage.py runserver"))
- #@TODO: really bad approach, better would be real python code, or subprocess \ No newline at end of file
+ host = self.pycore.config['webinterface']['host']
+ port = self.pycore.config['webinterface']['port']
+ self.pycore.logger.info("Starting Webserver: %s:%s" % (host,port) )
+ try:
+ subprocess.call(['python',join(self.pycore.path,"module","web","manage.py"), "runserver", "%s:%s" % (host,port)], close_fds=True)
+ except Exception, e:
+ print e
+ #os.system("python " + join(self.pycore.path,"module","web","manage.py runserver %s:%s" % (host,port)))
+ #@TODO: better would be real python code \ No newline at end of file