Simplified server restart to just touching lms/__init__.py rather than killing and restarting the server.

This commit is contained in:
Arjun Singh
2012-07-25 13:39:30 -04:00
parent c9a36a7085
commit e6ee3d50ba

View File

@@ -33,10 +33,7 @@ class DjangoEventHandler(FileSystemEventHandler):
for extension in EXTENSIONS:
if event.src_path.endswith(extension) or extension == "*":
print "%s changed: restarting server." % event.src_path
self.process.terminate()
os.system("ps aux | grep 'django' | grep -v grep | awk '{print $2}' | xargs kill")
time.sleep(0.25)
self.process = Popen(['rake', 'lms'])
os.system("touch lms/__init__.py")
break
if __name__ == "__main__":