Skip to content

Commit daccf3f

Browse files
committed
更新了部分文档
1 parent eb2cb5f commit daccf3f

File tree

13 files changed

+43
-39
lines changed

13 files changed

+43
-39
lines changed

Day01-15/01.初识Python.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ yum -y install wget gcc zlib-devel bzip2-devel openssl-devel ncurses-devel sqlit
5757
2. 下载Python源代码并解压缩到指定目录。
5858

5959
```Shell
60-
wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tgz
61-
xz -d Python-3.7.3.tar.xz
62-
tar -xvf Python-3.7.3.tar
60+
wget https://www.python.org/ftp/python/3.7.6/Python-3.7.6.tar.xz
61+
xz -d Python-3.7.6.tar.xz
62+
tar -xvf Python-3.7.6.tar
6363
```
6464

6565
3. 切换至Python源代码目录并执行下面的命令进行配置和安装。
6666

6767
```Shell
68-
cd Python-3.7.3
68+
cd Python-3.7.6
6969
./configure --prefix=/usr/local/python37 --enable-optimizations
7070
make && make install
7171
```

Day36-40/36-38.关系型数据库MySQL.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ MySQL在过去由于性能高、成本低、可靠性好,已经成为最流行
174174
alter user 'root'@'localhost' identified by '123456';
175175
```
176176

177-
> 说明:MySQL较新的版本默认不允许使用弱口令作为用户口令,所以我们通过上面的前两条命令修改了验证用户口令的策略和口令的长度。事实上我们不应该使用弱口令,因为存在用户口令被暴力破解的风险。近年来,攻击数据库窃取数据和劫持数据库勒索比特币的事件屡见不鲜,要避免这些潜在的风险,最为重要的一点是不要让数据库服务器暴露在公网上(最好的做法是将数据库置于内网,至少要做到不向公网开放数据库服务器的访问端口),另外要保管好`root`账号的口令,应用系统需要访问数据库时,通常不使用`root`账号进行访问,而是创建其他拥有适当权限的账号来访问。
177+
> **说明**:MySQL较新的版本默认不允许使用弱口令作为用户口令,所以我们通过上面的前两条命令修改了验证用户口令的策略和口令的长度。事实上我们不应该使用弱口令,因为存在用户口令被暴力破解的风险。近年来,攻击数据库窃取数据和劫持数据库勒索比特币的事件屡见不鲜,要避免这些潜在的风险,最为重要的一点是不要让数据库服务器暴露在公网上(最好的做法是将数据库置于内网,至少要做到不向公网开放数据库服务器的访问端口),另外要保管好`root`账号的口令,应用系统需要访问数据库时,通常不使用`root`账号进行访问,而是创建其他拥有适当权限的账号来访问。
178178

179179
再次使用客户端工具连接MySQL服务器时,就可以使用新设置的口令了。在实际开发中,为了方便用户操作,可以选择图形化的客户端工具来连接MySQL服务器,包括:
180180

@@ -1199,7 +1199,7 @@ insert into tb_emp values
11991199
# 1. 创建数据库连接对象
12001200
con = pymysql.connect(host='localhost', port=3306,
12011201
database='hrs', charset='utf8',
1202-
user='root', password='123456')
1202+
user='yourname', password='yourpass')
12031203
try:
12041204
# 2. 通过连接对象获取游标
12051205
with con.cursor() as cursor:
@@ -1231,7 +1231,7 @@ insert into tb_emp values
12311231
no = int(input('编号: '))
12321232
con = pymysql.connect(host='localhost', port=3306,
12331233
database='hrs', charset='utf8',
1234-
user='root', password='123456',
1234+
user='yourname', password='yourpass',
12351235
autocommit=True)
12361236
try:
12371237
with con.cursor() as cursor:
@@ -1263,7 +1263,7 @@ insert into tb_emp values
12631263
loc = input('所在地: ')
12641264
con = pymysql.connect(host='localhost', port=3306,
12651265
database='hrs', charset='utf8',
1266-
user='root', password='123456',
1266+
user='yourname', password='yourpass',
12671267
autocommit=True)
12681268
try:
12691269
with con.cursor() as cursor:
@@ -1291,7 +1291,7 @@ insert into tb_emp values
12911291
def main():
12921292
con = pymysql.connect(host='localhost', port=3306,
12931293
database='hrs', charset='utf8',
1294-
user='root', password='123456')
1294+
user='yourname', password='yourpass')
12951295
try:
12961296
with con.cursor(cursor=DictCursor) as cursor:
12971297
cursor.execute('select dno as no, dname as name, dloc as loc from tb_dept')
@@ -1334,7 +1334,7 @@ insert into tb_emp values
13341334
size = int(input('大小: '))
13351335
con = pymysql.connect(host='localhost', port=3306,
13361336
database='hrs', charset='utf8',
1337-
user='root', password='123456')
1337+
user='yourname', password='yourpass')
13381338
try:
13391339
with con.cursor() as cursor:
13401340
cursor.execute(

Day36-40/39-40.NoSQL入门.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ redis-server
107107
方式一:通过参数指定认证口令和AOF持久化方式。
108108

109109
```Shell
110-
redis-server --requirepass 1qaz2wsx --appendonly yes
110+
redis-server --requirepass yourpass --appendonly yes
111111
```
112112

113113
方式二:通过指定的配置文件来修改Redis的配置。
@@ -119,7 +119,7 @@ redis-server /root/redis-5.0.4/redis.conf
119119
下面我们使用第一种方式来启动Redis并将其置于后台运行,将Redis产生的输出重定向到名为redis.log的文件中。
120120

121121
```Shell
122-
redis-server --requirepass 1qaz2wsx > redis.log &
122+
redis-server --requirepass yourpass > redis.log &
123123
```
124124

125125
可以通过ps或者netstat来检查Redis服务器是否启动成功。
@@ -133,7 +133,7 @@ netstat -nap | grep redis-server
133133

134134
```Shell
135135
redis-cli
136-
127.0.0.1:6379> auth 1qaz2wsx
136+
127.0.0.1:6379> auth yourpass
137137
OK
138138
127.0.0.1:6379> ping
139139
PONG
@@ -274,7 +274,7 @@ python3
274274

275275
```Python
276276
>>> import redis
277-
>>> client = redis.Redis(host='1.2.3.4', port=6379, password='1qaz2wsx')
277+
>>> client = redis.Redis(host='1.2.3.4', port=6379, password='yourpass')
278278
>>> client.set('username', 'admin')
279279
True
280280
>>> client.hset('student', 'name', 'hao')

Day36-40/code/contact/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ def find_contacters(con):
171171

172172

173173
def main():
174-
con = pymysql.connect(host='120.77.222.217', port=3306,
175-
user='root', passwd='123456',
174+
con = pymysql.connect(host='1.2.3.4', port=3306,
175+
user='yourname', passwd='yourpass',
176176
db='address', charset='utf8',
177177
autocommit=True,
178178
cursorclass=pymysql.cursors.DictCursor)

Day41-55/42.深入模型.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
'default': {
3030
'ENGINE': 'django.db.backends.mysql',
3131
'NAME': 'oa',
32-
'HOST': '127.0.0.1',
32+
'HOST': '1.2.3.4',
3333
'PORT': 3306,
34-
'USER': 'root',
35-
'PASSWORD': '123456',
34+
'USER': 'yourname',
35+
'PASSWORD': 'yourpass',
3636
}
3737
}
3838

Day41-55/code/shop/shop/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@
8181
'NAME': 'shop',
8282
'HOST': 'localhost',
8383
'PORT': 3306,
84-
'USER': 'root',
85-
'PASSWORD': '123456',
84+
'USER': 'yourname',
85+
'PASSWORD': 'yourpass',
8686
}
8787
}
8888

Day41-55/code/shop_origin/shop/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@
8181
'NAME': 'Shop',
8282
'HOST': 'localhost',
8383
'PORT': 3306,
84-
'USER': 'root',
85-
'PASSWORD': '123456',
84+
'USER': 'yourname',
85+
'PASSWORD': 'yourpass',
8686
}
8787
}
8888

Day61-65/code/hello-tornado/example04.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414

1515
define('port', default=8888, type=int)
1616

17+
# 请求天行数据提供的API数据接口
1718
REQ_URL = 'http://api.tianapi.com/guonei/'
18-
API_KEY = '772a81a51ae5c780251b1f98ea431b84'
19+
# 在天行数据网站注册后可以获得API_KEY
20+
API_KEY = 'your_personal_api_key'
1921

2022

2123
class MainHandler(tornado.web.RequestHandler):

Day61-65/code/hello-tornado/example05.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414

1515
define('port', default=8888, type=int)
1616

17+
# 请求天行数据提供的API数据接口
1718
REQ_URL = 'http://api.tianapi.com/guonei/'
18-
API_KEY = '772a81a51ae5c780251b1f98ea431b84'
19+
# 在天行数据网站注册后可以获得API_KEY
20+
API_KEY = 'your_personal_api_key'
1921

2022

2123
class MainHandler(tornado.web.RequestHandler):

Day61-65/code/hello-tornado/example06.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515

1616
async def connect_mysql():
1717
return await aiomysql.connect(
18-
host='120.77.222.217',
18+
host='1.2.3.4',
1919
port=3306,
2020
db='hrs',
2121
charset='utf8',
2222
use_unicode=True,
23-
user='root',
24-
password='123456',
23+
user='yourname',
24+
password='yourpass',
2525
)
2626

2727

Day61-65/code/hello-tornado/example07.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121

2222
def get_mysql_connection():
2323
return connect(
24-
host='120.77.222.217',
24+
host='1.2.3.4',
2525
port=3306,
2626
db='hrs',
2727
charset='utf8',
2828
use_unicode=True,
29-
user='root',
30-
password='123456',
29+
user='yourname',
30+
password='yourpass',
3131
)
3232

3333

Day61-65/code/project_of_tornado/backend_server.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919

2020
async def connect_mysql():
2121
return await aiomysql.connect(
22-
host='120.77.222.217',
22+
host='1.2.3.4',
2323
port=3306,
2424
db='hrs',
2525
charset='utf8',
2626
use_unicode=True,
27-
user='root',
28-
password='123456',
27+
user='yourname',
28+
password='yourpass',
2929
)
3030

3131

Day91-100/95.使用Django开发商业项目.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ CACHES = {
853853
'CONNECTION_POOL_KWARGS': {
854854
'max_connections': 1000,
855855
},
856-
'PASSWORD': '1qaz2wsx',
856+
'PASSWORD': 'yourpass',
857857
}
858858
},
859859
# 页面缓存
@@ -868,7 +868,7 @@ CACHES = {
868868
'CONNECTION_POOL_KWARGS': {
869869
'max_connections': 500,
870870
},
871-
'PASSWORD': '1qaz2wsx',
871+
'PASSWORD': 'yourpass',
872872
}
873873
},
874874
# 会话缓存
@@ -884,7 +884,7 @@ CACHES = {
884884
'CONNECTION_POOL_KWARGS': {
885885
'max_connections': 2000,
886886
},
887-
'PASSWORD': '1qaz2wsx',
887+
'PASSWORD': 'yourpass',
888888
}
889889
},
890890
# 接口数据缓存
@@ -899,7 +899,7 @@ CACHES = {
899899
'CONNECTION_POOL_KWARGS': {
900900
'max_connections': 500,
901901
},
902-
'PASSWORD': '1qaz2wsx',
902+
'PASSWORD': 'yourpass',
903903
}
904904
},
905905
}
@@ -1781,7 +1781,7 @@ CORS_ORIGIN_ALLOW_ALL = True
17811781
>>> signer.unsign(value)
17821782
'hello, world!'
17831783
>>>
1784-
>>> signer = Signer(salt='1qaz2wsx')
1784+
>>> signer = Signer(salt='yoursalt')
17851785
>>> signer.sign('hello, world!')
17861786
'hello, world!:9vEvG6EA05hjMDB5MtUr33nRA_M'
17871787
>>>

0 commit comments

Comments
 (0)