vault backup: 2024-05-28 14:23:50

This commit is contained in:
2024-05-28 14:23:50 +08:00
parent cc1fd6974b
commit 9c62b93c48
2 changed files with 28 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
---
tags: logitech, autoserver, kirby
aliases:
date: 2024-05-28
time: 14:20:24
description:
---
- 要加入 templates、static 與其他的靜態檔案
- DB 位置不能用相對路徑,必須[[Determine Python is running as a script or as a frozen exe]],然後更新路徑
- 要把 `flask db upgrade` 也變成 EXE 檔。
# 參考來源

View File

@@ -0,0 +1,14 @@
```python
import os
import sys
config_name = 'myapp.cfg'
# determine if application is a script file or frozen exe
if getattr(sys, 'frozen', False):
application_path = os.path.dirname(sys.executable)
elif __file__:
application_path = os.path.dirname(__file__)
config_path = os.path.join(application_path, config_name)
```