mirror of
https://github.com/ngfchl/ptools
synced 2023-07-10 13:41:22 +08:00
1. 增加规则更新功能(直接操作数据库,有风险,请定期备份数据库)
2. 更新部分站点规则
This commit is contained in:
@@ -126,6 +126,7 @@ def do_update(request):
|
||||
# 更新数据库
|
||||
with open('main_pt_site_site.sql', encoding='utf-8') as sql_file:
|
||||
contents = sql_file.readlines()
|
||||
print(contents[0])
|
||||
with connection.cursor() as cursor:
|
||||
for statement in contents:
|
||||
cursor.execute(statement)
|
||||
|
||||
Reference in New Issue
Block a user