mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-14 04:19:00 +00:00
Fixes issue with Frozen server and templates directory.
This commit is contained in:
parent
7b58f14681
commit
a0a5705fd8
@ -32,6 +32,7 @@ import socket
|
||||
import tornado.ioloop
|
||||
import tornado.web
|
||||
import tornado.autoreload
|
||||
import pkg_resources
|
||||
|
||||
from pkg_resources import parse_version
|
||||
from .config import Config
|
||||
@ -143,8 +144,12 @@ class Server(object):
|
||||
router = self._create_zmq_router()
|
||||
# Add our JSON-RPC Websocket handler to Tornado
|
||||
self.handlers.extend([(r"/", JSONRPCWebSocket, dict(zmq_router=router))])
|
||||
if hasattr(sys, "frozen"):
|
||||
templates_dir = "templates"
|
||||
else:
|
||||
templates_dir = pkg_resources.resource_filename("gns3server", "templates")
|
||||
tornado_app = tornado.web.Application(self.handlers,
|
||||
template_path=os.path.join(os.path.dirname(__file__), "templates"),
|
||||
template_path=templates_dir,
|
||||
debug=True) # FIXME: debug mode!
|
||||
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user