Skip to content

Commit dce8835

Browse files
committed
演示项目
1 parent 2167a20 commit dce8835

18 files changed

+11331
-0
lines changed

README.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
## 说明
2+
websocket+Django+python+paramiko实现web页面执行命令并实时输出
3+
4+
## 环境依赖
5+
6+
| Project | Status | Description |
7+
|---------|--------|-------------|
8+
| python | 3.5.4 | 在这个版本以及以上都课可以 |
9+
| django | 2.1.4 | 大于2.0,小于2.1.5 |
10+
| paramiko | 2.4.2 ||
11+
12+
## 注意事项
13+
14+
django版本不能是2.1.5,使用websocket,谷歌浏览器会报错
15+
16+
`WebSocket connection to 'ws://127.0.01:8000/echo_once/' failed: Error during WebSocket handshake: Unexpected response code: 400`
17+
18+
## 安装依赖
19+
`pip3 install -r requirements.txt`
20+
21+
或者
22+
23+
`pip3 install paramiko dwebsocket django==2.1.4`
24+
25+
## 运行方式
26+
27+
使用Pycharm直接运行即可
28+
29+
或者使用命令
30+
`python manage.py runserver`
31+
32+
33+
## 效果图
34+
35+
![Image text](https://github.com/py3study/bmt/blob/master/效果图.png)
36+
Copyright (c) 2018-present, xiao You

manage.py

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env python
2+
import os
3+
import sys
4+
5+
if __name__ == "__main__":
6+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "wdpy.settings")
7+
try:
8+
from django.core.management import execute_from_command_line
9+
except ImportError as exc:
10+
raise ImportError(
11+
"Couldn't import Django. Are you sure it's installed and "
12+
"available on your PYTHONPATH environment variable? Did you "
13+
"forget to activate a virtual environment?"
14+
) from exc
15+
execute_from_command_line(sys.argv)

requirements.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Django==2.1.4
2+
dwebsocket==0.5.10
3+
paramiko==2.4.2

0 commit comments

Comments
 (0)