Skip to content

Commit f1fde3f

Browse files
author
Qiliping
committed
新增gunicorn.conf
1 parent a928975 commit f1fde3f

File tree

2,172 files changed

+134674
-7
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,172 files changed

+134674
-7
lines changed

.idea/workspace.xml

+962
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

__pycache__/app.cpython-37.pyc

10.8 KB
Binary file not shown.
858 Bytes
Binary file not shown.

__pycache__/tasks.cpython-37.pyc

811 Bytes
Binary file not shown.

app.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def hello_world():
3535
print("耗时的请求")
3636
result = long_time_def.delay()
3737
print(result.result)
38-
result.wait() # 65
38+
# result.wait() # 65
3939

4040
return redirect("/manage/login")
4141
# return Response(json.dumps(result), mimetype='application/json')
@@ -437,7 +437,8 @@ def manage_site_publish(id):
437437
publisher = Publisher()
438438
publisher.sftp_put(remote_dir, local_dir, site['web_path'], site['host'], site['port'],
439439
site['user_name'],
440-
site['user_pwd'])
440+
site['user_pwd'],
441+
site['nginx_config_path'])
441442

442443
# 更新网站状态为:已生成
443444
site_service.update_released_state(id)

core/Publisher.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
import datetime
33
import os
44

5-
class Publisher(object):
65

6+
class Publisher(object):
77

88
# sftp上传到服务器
9-
def sftp_put(self, remote_dir, local_dir, site_id, server_host, server_port, user_name, user_pwd):
9+
def sftp_put(self, remote_dir, local_dir, site_id, server_host, server_port, user_name, user_pwd,
10+
nginx_config_path):
1011
# 连接服务器
1112
transport = paramiko.Transport((server_host, server_port))
1213
transport.connect(username=user_name, password=user_pwd)
@@ -71,7 +72,7 @@ def sftp_put(self, remote_dir, local_dir, site_id, server_host, server_port, use
7172
#
7273
#
7374
# # 将resutl.txt 上传至服务器 /tmp/result.txt
74-
sftp.put(local_dir + '/' + site_id + '.conf', '/etc/nginx/conf.d/' + site_id + '.conf')
75+
sftp.put(local_dir + '/' + site_id + '.conf', nginx_config_path + site_id + '.conf')
7576
# # 将result.txt 下载到本地
7677
# sftp.get('/tmp/result.txt', '~/yours.txt')
7778
transport.close()
2.78 KB
Binary file not shown.
1.64 KB
Binary file not shown.
151 Bytes
Binary file not shown.

gunicorn.conf

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import os
2+
3+
bind='127.0.0.1:5000' #运行的地址
4+
5+
workers=4 #处理请求的进程数
6+
7+
proc_name='site_group_manage' #进程名称

module/Site.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def add_single(self, site_model):
2323
:param site_model:
2424
:return:
2525
"""
26-
sql = "INSERT INTO `site` (`title`, `web_path`,`template_id`, `domain`,`keyword`, `description`,`state`, `create_time`,`article_ids`,`server_id`) VALUES (%s, %s, %s, %s, %s,%s,%s,%s,%s,%s)"
26+
sql = "INSERT INTO `site` (`title`, `web_path`,`template_id`, `domain`,`keyword`, `description`,`state`, `create_time`,`article_id`,`server_id`) VALUES (%s, %s, %s, %s, %s,%s,%s,%s,%s,%s)"
2727
# cursor.execute(sql, (
2828
# str(title), str(web_path), template, str(domain), str(keyword), str(description), 0,
2929
# int(time.time()), str(article_ids), str(server_id)))
488 Bytes
Binary file not shown.
4.78 KB
Binary file not shown.
1.23 KB
Binary file not shown.
4.12 KB
Binary file not shown.
637 Bytes
Binary file not shown.
153 Bytes
Binary file not shown.
651 Bytes
Binary file not shown.
4.69 KB
Binary file not shown.
Binary file not shown.
154 Bytes
Binary file not shown.

static/loading.gif

3.81 KB
Loading

templates/manage/site_list.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@
5353
<tr>
5454
<td>{{ site.title }}</td>
5555
<td>{{ site.template_title }}({% if site.type == 0 %}单页面{% else %}多页面{% endif %})</td>
56-
<td>{{ site.domain }}</td>
56+
<td>
57+
<a href="http://{{ site.domain }}">
58+
{{ site.domain }}
59+
</a>
60+
</td>
5761
<td>{{ site.host }}</td>
5862
<td>{{ site.description }}</td>
5963
<td>
1.93 KB
Binary file not shown.
152 Bytes
Binary file not shown.
429 Bytes
Binary file not shown.

venv/bin/celery

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/Users/zhuming/Project/python/site_group_manage/venv/bin/python
2+
# EASY-INSTALL-ENTRY-SCRIPT: 'celery==4.2.0','console_scripts','celery'
3+
__requires__ = 'celery==4.2.0'
4+
import re
5+
import sys
6+
from pkg_resources import load_entry_point
7+
8+
if __name__ == '__main__':
9+
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
10+
sys.exit(
11+
load_entry_point('celery==4.2.0', 'console_scripts', 'celery')()
12+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
Metadata-Version: 2.1
2+
Name: DBUtils
3+
Version: 1.3
4+
Summary: Database connections for multi-threaded environments.
5+
Home-page: https://cito.github.io/DBUtils/
6+
Author: Christoph Zwerschke
7+
Author-email: [email protected]
8+
License: MIT License
9+
Description: DBUtils
10+
=======
11+
12+
DBUtils is a suite of tools providing solid, persistent and pooled connections
13+
to a database that can be used in all kinds of multi-threaded environments
14+
like Webware for Python or other web application servers. The suite supports
15+
DB-API 2 compliant database interfaces and the classic PyGreSQL interface.
16+
17+
The current version of DBUtils supports Python versions 2.6, 2.7 and 3.4 - 3.7.
18+
19+
The DBUtils home page can be found here: https://cito.github.io/DBUtils/
20+
21+
Platform: any
22+
Classifier: Development Status :: 5 - Production/Stable
23+
Classifier: Environment :: Web Environment
24+
Classifier: Intended Audience :: Developers
25+
Classifier: License :: OSI Approved :: MIT License
26+
Classifier: Programming Language :: Python
27+
Classifier: Programming Language :: Python :: 2
28+
Classifier: Programming Language :: Python :: 2.6
29+
Classifier: Programming Language :: Python :: 2.7
30+
Classifier: Programming Language :: Python :: 3
31+
Classifier: Programming Language :: Python :: 3.4
32+
Classifier: Programming Language :: Python :: 3.5
33+
Classifier: Programming Language :: Python :: 3.6
34+
Classifier: Programming Language :: Python :: 3.7
35+
Classifier: Topic :: Database
36+
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
37+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
38+
Description-Content-Type: text/markdown
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
README.md
2+
DBUtils/PersistentDB.py
3+
DBUtils/PersistentPg.py
4+
DBUtils/PooledDB.py
5+
DBUtils/PooledPg.py
6+
DBUtils/Properties.py
7+
DBUtils/SimplePooledDB.py
8+
DBUtils/SimplePooledPg.py
9+
DBUtils/SteadyDB.py
10+
DBUtils/SteadyPg.py
11+
DBUtils/__init__.py
12+
DBUtils.egg-info/PKG-INFO
13+
DBUtils.egg-info/SOURCES.txt
14+
DBUtils.egg-info/dependency_links.txt
15+
DBUtils.egg-info/top_level.txt
16+
DBUtils/Docs/Doc.css
17+
DBUtils/Docs/DocUtils.css
18+
DBUtils/Docs/RelNotes-0.8.1.html
19+
DBUtils/Docs/RelNotes-0.9.1.html
20+
DBUtils/Docs/RelNotes-0.9.2.html
21+
DBUtils/Docs/RelNotes-0.9.3.html
22+
DBUtils/Docs/RelNotes-0.9.4.html
23+
DBUtils/Docs/RelNotes-1.0.html
24+
DBUtils/Docs/RelNotes-1.1.1.html
25+
DBUtils/Docs/RelNotes-1.1.html
26+
DBUtils/Docs/RelNotes-1.2.html
27+
DBUtils/Docs/RelNotes-1.3.html
28+
DBUtils/Docs/UsersGuide.de.html
29+
DBUtils/Docs/UsersGuide.de.rst
30+
DBUtils/Docs/UsersGuide.html
31+
DBUtils/Docs/UsersGuide.rst
32+
DBUtils/Docs/dbdep.gif
33+
DBUtils/Docs/persist.gif
34+
DBUtils/Docs/pgdep.gif
35+
DBUtils/Docs/pool.gif
36+
DBUtils/Examples/DBUtilsExample.py
37+
DBUtils/Examples/Main.py
38+
DBUtils/Examples/__init__.py
39+
DBUtils/Tests/TestPersistentDB.py
40+
DBUtils/Tests/TestPersistentPg.py
41+
DBUtils/Tests/TestPooledDB.py
42+
DBUtils/Tests/TestPooledPg.py
43+
DBUtils/Tests/TestSimplePooledDB.py
44+
DBUtils/Tests/TestSimplePooledPg.py
45+
DBUtils/Tests/TestSteadyDB.py
46+
DBUtils/Tests/TestSteadyPg.py
47+
DBUtils/Tests/TestThreadingLocal.py
48+
DBUtils/Tests/__init__.py
49+
DBUtils/Tests/mock_db.py
50+
DBUtils/Tests/mock_pg.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
../DBUtils/Docs/Doc.css
2+
../DBUtils/Docs/DocUtils.css
3+
../DBUtils/Docs/RelNotes-0.8.1.html
4+
../DBUtils/Docs/RelNotes-0.9.1.html
5+
../DBUtils/Docs/RelNotes-0.9.2.html
6+
../DBUtils/Docs/RelNotes-0.9.3.html
7+
../DBUtils/Docs/RelNotes-0.9.4.html
8+
../DBUtils/Docs/RelNotes-1.0.html
9+
../DBUtils/Docs/RelNotes-1.1.1.html
10+
../DBUtils/Docs/RelNotes-1.1.html
11+
../DBUtils/Docs/RelNotes-1.2.html
12+
../DBUtils/Docs/RelNotes-1.3.html
13+
../DBUtils/Docs/UsersGuide.de.html
14+
../DBUtils/Docs/UsersGuide.de.rst
15+
../DBUtils/Docs/UsersGuide.html
16+
../DBUtils/Docs/UsersGuide.rst
17+
../DBUtils/Docs/dbdep.gif
18+
../DBUtils/Docs/persist.gif
19+
../DBUtils/Docs/pgdep.gif
20+
../DBUtils/Docs/pool.gif
21+
../DBUtils/Examples/DBUtilsExample.py
22+
../DBUtils/Examples/Main.py
23+
../DBUtils/Examples/__init__.py
24+
../DBUtils/Examples/__pycache__/DBUtilsExample.cpython-37.pyc
25+
../DBUtils/Examples/__pycache__/Main.cpython-37.pyc
26+
../DBUtils/Examples/__pycache__/__init__.cpython-37.pyc
27+
../DBUtils/PersistentDB.py
28+
../DBUtils/PersistentPg.py
29+
../DBUtils/PooledDB.py
30+
../DBUtils/PooledPg.py
31+
../DBUtils/Properties.py
32+
../DBUtils/SimplePooledDB.py
33+
../DBUtils/SimplePooledPg.py
34+
../DBUtils/SteadyDB.py
35+
../DBUtils/SteadyPg.py
36+
../DBUtils/Tests/TestPersistentDB.py
37+
../DBUtils/Tests/TestPersistentPg.py
38+
../DBUtils/Tests/TestPooledDB.py
39+
../DBUtils/Tests/TestPooledPg.py
40+
../DBUtils/Tests/TestSimplePooledDB.py
41+
../DBUtils/Tests/TestSimplePooledPg.py
42+
../DBUtils/Tests/TestSteadyDB.py
43+
../DBUtils/Tests/TestSteadyPg.py
44+
../DBUtils/Tests/TestThreadingLocal.py
45+
../DBUtils/Tests/__init__.py
46+
../DBUtils/Tests/__pycache__/TestPersistentDB.cpython-37.pyc
47+
../DBUtils/Tests/__pycache__/TestPersistentPg.cpython-37.pyc
48+
../DBUtils/Tests/__pycache__/TestPooledDB.cpython-37.pyc
49+
../DBUtils/Tests/__pycache__/TestPooledPg.cpython-37.pyc
50+
../DBUtils/Tests/__pycache__/TestSimplePooledDB.cpython-37.pyc
51+
../DBUtils/Tests/__pycache__/TestSimplePooledPg.cpython-37.pyc
52+
../DBUtils/Tests/__pycache__/TestSteadyDB.cpython-37.pyc
53+
../DBUtils/Tests/__pycache__/TestSteadyPg.cpython-37.pyc
54+
../DBUtils/Tests/__pycache__/TestThreadingLocal.cpython-37.pyc
55+
../DBUtils/Tests/__pycache__/__init__.cpython-37.pyc
56+
../DBUtils/Tests/__pycache__/mock_db.cpython-37.pyc
57+
../DBUtils/Tests/__pycache__/mock_pg.cpython-37.pyc
58+
../DBUtils/Tests/mock_db.py
59+
../DBUtils/Tests/mock_pg.py
60+
../DBUtils/__init__.py
61+
../DBUtils/__pycache__/PersistentDB.cpython-37.pyc
62+
../DBUtils/__pycache__/PersistentPg.cpython-37.pyc
63+
../DBUtils/__pycache__/PooledDB.cpython-37.pyc
64+
../DBUtils/__pycache__/PooledPg.cpython-37.pyc
65+
../DBUtils/__pycache__/Properties.cpython-37.pyc
66+
../DBUtils/__pycache__/SimplePooledDB.cpython-37.pyc
67+
../DBUtils/__pycache__/SimplePooledPg.cpython-37.pyc
68+
../DBUtils/__pycache__/SteadyDB.cpython-37.pyc
69+
../DBUtils/__pycache__/SteadyPg.cpython-37.pyc
70+
../DBUtils/__pycache__/__init__.cpython-37.pyc
71+
PKG-INFO
72+
SOURCES.txt
73+
dependency_links.txt
74+
top_level.txt
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DBUtils

0 commit comments

Comments
 (0)