diff --git a/backend/extra-hooks/__init__.py b/backend/extra-hooks/__init__.py deleted file mode 100644 index ea9158f..0000000 --- a/backend/extra-hooks/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# 用于build exe 使用 \ No newline at end of file diff --git a/backend/main.py b/backend/main.py index b12587d..2408243 100644 --- a/backend/main.py +++ b/backend/main.py @@ -1,27 +1,13 @@ import multiprocessing import os import sys -import time -import threading -import webbrowser root_path = os.getcwd() sys.path.append(root_path) import uvicorn -from pathlib import Path from application.settings import LOGGING -BASE_DIR = Path(__file__).resolve().parent.parent -url = "http://127.0.0.1:8000/web/" - - -def open_browser_after_delay(url, delay): - time.sleep(delay) - webbrowser.open(url) - - if __name__ == '__main__': multiprocessing.freeze_support() - threading.Thread(target=open_browser_after_delay, args=(url, 3)).start() uvicorn.run("application.asgi:application", reload=False, host="0.0.0.0", port=8000, workers=4, log_config=LOGGING) diff --git a/backend/main.spec b/backend/main.spec deleted file mode 100644 index 5d87acb..0000000 --- a/backend/main.spec +++ /dev/null @@ -1,83 +0,0 @@ -# -*- mode: python ; coding: utf-8 -*- - - -a = Analysis( - ['main.py'], - pathex=['./'], - binaries=[], - datas=[ - ('./static', 'static'), - ('./static/captcha/fonts', 'captcha/fonts'), - ('./templates', 'templates'), - ('./dvadmin/system/util', 'dvadmin/system/util'), - ('./plugins/__init__.py', 'plugins/__init__.py'), - ('./db.sqlite3', './'), - ], - hiddenimports=[ - "django", - "testfixtures", - "django.contrib.auth", - "django.contrib.contenttypes", - "django.contrib.sessions", - "django.contrib.messages", - "django.contrib.staticfiles", - "django_comment_migrate", - "rest_framework", - "django_filters", - "corsheaders", # 注册跨域app - "drf_yasg", - "captcha", - "channels", - "dvadmin.system", - "plugins.gla", - "testfixtures", - "application.asgi", - "dvadmin.utils.middleware", - "whitenoise", - "whitenoise.middleware", - "whitenoise.storage", - "dvadmin.utils.pagination", - "dvadmin.utils.exception", - "rest_framework_simplejwt.state", - ], - hookspath=['./extra-hooks'], - hooksconfig={}, - runtime_hooks=[], - excludes=[], - noarchive=False, - optimize=0, -) -pyz = PYZ(a.pure) - -exe = EXE( - pyz, - a.scripts, - [], - exclude_binaries=True, - name='main', - debug=False, - bootloader_ignore_signals=False, - strip=False, - upx=True, - console=False, - disable_windowed_traceback=False, - argv_emulation=False, - target_arch=None, - codesign_identity=None, - entitlements_file=None, -) -coll = COLLECT( - exe, - a.binaries, - a.datas, - strip=False, - upx=True, - upx_exclude=[], - name='main', -) -app = BUNDLE( - coll, - name='main.app', - icon=None, - bundle_identifier=None, -)