Archived
修复bug
This commit is contained in:
2 files changed
+15
-16
No files matched your search
@@ -6,6 +6,8 @@
|
||||
# @File Name: __init__.py
|
||||
|
||||
|
||||
import os
|
||||
import requests
|
||||
from flask import Flask
|
||||
from .main import main
|
||||
from .db.db import SQLite
|
||||
@@ -24,3 +26,16 @@ def create_app():
|
||||
app.config.from_object(Config)
|
||||
|
||||
return app
|
||||
|
||||
|
||||
def download():
|
||||
res = requests.get('http://resource-base.herokuapp.com/download/data.db')
|
||||
with open('./app/db/data.db', 'wb') as fp:
|
||||
fp.write(res.content)
|
||||
|
||||
|
||||
if __name__ != '__main__':
|
||||
if not os.path.exists('./app/db/data.db'):
|
||||
print('数据库文件未找到, 正在下载中')
|
||||
download()
|
||||
print('下载完成')
|
||||
Reference in New Issue
Block a user