diff --git a/README.md b/README.md index e3f3a9c856c65da3904f5190344f28ea4aacf057..a926debd3e5c4705b93fdf3c95226a8ff08b14ae 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -

kcweb==4.12.3框架简要说明

+

kcweb==4.13.26框架简要说明

kcweb作为web开发而设计的高性能框架,采用全新的架构思想,注重易用性。遵循MIT开源许可协议发布,意味着个人和企业可以免费使用kcweb,甚至允许把你基于kcweb开发的应用开源或商业产品发布或销售。 -[官方完整文档](https://intapp.kwebapp.cn/intapp/doc/index/finddoc/1/29/1 "官方文档") +[官方完整文档](https://intapp.kwebapp.cn/intapp/doc/index/finddoc/1/49/1 "官方文档") ------------ diff --git a/app.py b/app.py index d631d601d89d3842429ca567da56c806de0acb63..3649151109d040b66de3215fef110e445206bd82 100644 --- a/app.py +++ b/app.py @@ -386,7 +386,10 @@ class web: globals.HEADER.HTTP_COOKIE=header['HTTP_COOKIE'] except: globals.HEADER.HTTP_COOKIE=None - globals.HEADER.HTTP_USER_AGENT=header['HTTP_USER_AGENT'] + try: + globals.HEADER.HTTP_USER_AGENT=header['HTTP_USER_AGENT'] + except: + globals.HEADER.HTTP_USER_AGENT=None def __del_globals(): globals.VAR = local() globals.HEADER = local() @@ -616,8 +619,10 @@ class web: web.__del_globals() #关闭数据库连接 - dbs=kcwmysql.mysql() - dbs.close() + try: + dbs=kcwmysql.mysql() + dbs.close() + except:pass # dbs=kcwsqlite.sqlite() # dbs.close() diff --git a/common/autoload.py b/common/autoload.py index 9d1c5cea66b8dbc77d9c7db0b413027949641009..fb16645905830b41d5dfb5bb2503839b981daf89 100644 --- a/common/autoload.py +++ b/common/autoload.py @@ -700,16 +700,16 @@ class response: HTTP_IF_NONE_MATCH=globals.HEADER.GET['HTTP_IF_NONE_MATCH'] except: HTTP_IF_NONE_MATCH=None - if HTTP_IF_NONE_MATCH and get_cache(ETag): + if HTTP_IF_NONE_MATCH and HTTP_IF_NONE_MATCH==ETag: status="304 Not Modified" body='' else: - if isinstance(response_cache,int) and response_cache>1: - headers['response_cache']=str(response_cache)+" s" - set_cache(ETag,1,response_cache) - else: - headers['response_cache']="default" - set_cache(ETag,1) + # if isinstance(response_cache,int) and response_cache>1: + # headers['response_cache']=str(response_cache)+" s" + # set_cache(ETag,1,response_cache) + # else: + # headers['response_cache']="default" + # set_cache(ETag,1) body=Template(Temppath,**context) dateArray = core_datetime.datetime.utcfromtimestamp(times()-86400) otherStyleTime = dateArray.strftime('%a, %d %b %Y %H:%M:%S GMT') diff --git a/config/__init__.py b/config/__init__.py index cf527739f29dbd4f823a8fbc2b9ba46cbeea5eb7..ccab9c90c33f5f6f56cbe1e1427152ab75490c82 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -64,6 +64,7 @@ database['deploy']=0 # 数据库部署方式:0 集中式(单一服务器),1 分 database['master_num']=1 #主服务器数量 不能超过host服务器数量 (等于服务器数量表示读写不分离:主主复制。 小于服务器表示读写分离:主从复制。) mysql数据库有效 database['master_dql']=False #主服务器是否可以执行dql语句 是否可以执行select语句 主服务器数量大于等于host服务器数量时必须设置True database['break']=0 #断线重连次数,0表示不重连。 注:cli模式下 10秒进行一次重连并且连接次数是当前配置的300倍 +database['autocommit']=False #自动提交查询事务 #sqlite配置 sqlite={} @@ -101,7 +102,7 @@ email['recNick']='' #默认收件人昵称 kcweb={} kcweb['name']='kcweb' #项目的名称 -kcweb['version']='4.13.18' #项目版本 +kcweb['version']='4.13.26' #项目版本 kcweb['description']='' #项目的简单描述 kcweb['long_description']='' #项目详细描述 kcweb['license']='MIT' #开源协议 mit开源 @@ -114,11 +115,11 @@ kcweb['username']='' kcweb['password']='' domain={} -domain['kcwebfile']="https://file.kwebapp.cn" -domain['kcwebstatic']="https://static.kwebapp.cn" -domain['kcwebimg']="https://img.kwebapp.cn" +domain['kcwebfile']="https://fanshufile.oss-cn-beijing.aliyuncs.com" +domain['kcwebstatic']="https://fanshustatic.oss-cn-beijing.aliyuncs.com" +domain['kcwebimg']="https://fanshuimg.oss-cn-beijing.aliyuncs.com" # domain['kcwebapi']="//kcweb.kwebapp.cn" -domain['kcwebapi']="https://kcweb.kwebapp.cn" +domain['kcwebapi']="http://124.223.99.60:49001/index/index" #其他配置 other={} diff --git a/setup.py b/setup.py index 75f1fa3ab1daf88af4095fe3dfd3d70169ca1f36..e972b327b53eeebcadad711c35d046f5ed3a17ff 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,6 @@ # python3 setup.py sdist upload +# python setup.py sdist upload # twine upload --repository-url https://test.pypi.org/legacy/ dist/* #上传到测试 # pip install --index-url https://pypi.org/simple/ kcweb #安装测试服务上的kcweb pip3 install kcweb==4.12.4 -i https://pypi.org/simple/ ############################################# @@ -16,9 +17,9 @@ def file_get_content(k): return con confkcw={} confkcw['name']='kcweb' #项目的名称 -confkcw['version']='4.13.18' #项目版本 +confkcw['version']='4.13.26' #项目版本 confkcw['description']='' #项目的简单描述 -confkcw['long_description']="增加任务队列进度条" #项目详细描述 +confkcw['long_description']="mysql优化" #项目详细描述 confkcw['license']='MIT License' #开源协议 mit开源 confkcw['url']='' confkcw['author']='禄可集团-坤坤' #名字 diff --git a/utill/db/mysql.py b/utill/db/mysql.py index 1c3558b2de3c1cb03721440efa5f10362d45e7ec..33350dd6670d18d04a00e049339469289af7d02d 100644 --- a/utill/db/mysql.py +++ b/utill/db/mysql.py @@ -116,7 +116,7 @@ class mysql: i=0 masterlistsdb=[] while i