Removed public folder in production

This commit is contained in:
RemixDev 2020-09-08 13:40:48 +02:00
parent da0b4dc6dc
commit 326ea8a112
3 changed files with 6 additions and 2 deletions

View file

@ -9,7 +9,7 @@ sys.modules['FixTk'] = None
a = Analysis(['deemix-pyweb.py'],
binaries=[],
datas=[('webui/public', 'webui/public'), ('icon.ico', '.')],
datas=[('webui/public', 'webui'), ('icon.ico', '.')],
hiddenimports=['engineio.async_drivers.threading', 'pkg_resources.py2_warn'],
hookspath=[],
runtime_hooks=[],

View file

@ -53,6 +53,10 @@ def resource_path(relative_path):
return path.join(base_path, relative_path)
gui_dir = resource_path(path.join('webui', 'public'))
if not path.exists(gui_dir):
gui_dir = resource_path('webui')
if not path.isfile(path.join(gui_dir, 'index.html')):
sys.exit("WebUI not found, please download and add a WebUI")
server = CustomFlask(__name__, static_folder=gui_dir, template_folder=gui_dir, static_url_path="")
server.config['SEND_FILE_MAX_AGE_DEFAULT'] = 1 # disable caching
socketio = SocketIO(server, async_mode='threading')

View file

@ -9,7 +9,7 @@ sys.modules['FixTk'] = None
a = Analysis(['server.py'],
binaries=[],
datas=[('webui/public', 'webui/public')],
datas=[('webui/public', 'webui')],
hiddenimports=['engineio.async_drivers.threading', 'pkg_resources.py2_warn'],
hookspath=[],
runtime_hooks=[],