Skip to content

Commit 856a514

Browse files
committed
edit documentation
1 parent 4740fd5 commit 856a514

File tree

3 files changed

+69
-3
lines changed

3 files changed

+69
-3
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ build/
4141
manga.md
4242
auto_tool.bat
4343
auto_tool.py
44+
db.sql
45+
export.sqlite3
4446
/mdict/readlib/src/readmdict-py3/
4547
!/static/json/manifest.json
4648
!/static/json/index_en.json

doc/doc_en/doc_question.md

+33-1
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,43 @@ Do not set the django-mdict folder and the folder where the dictionary is locate
135135

136136
22. django.db.utils.DatabaseError: database disk image is malformed
137137

138+
For Windows:
139+
138140
a. [Download sqlite tool](https://www.sqlite.org/download.html)
139141

142+
a.1 Download sqlite-dll-win-x64-3460000.zip and extract it to a certain path.
143+
144+
a.2 Add this path to the system environment variable Path.
145+
140146
b. [Repair db.sqlite3 file](https://blog.csdn.net/qq_41539778/article/details/136531120)
141147

142-
c. Rename exported file to db.sqlite3.
148+
b.1. Navigate to the root directory of django-mdict in the command prompt (cmd).
149+
150+
b.2. Export the contents of the corrupted db.sqlite3 to db.sql.
151+
152+
```
153+
sqlite3 db.sqlite3
154+
.mode insert
155+
.output db.sql
156+
.dump
157+
.exit
158+
```
159+
b.3. Export db.sql to export.sqlite3.
160+
161+
```
162+
sqlite3
163+
.open export.sqlite3
164+
.read db.sql
165+
.exit
166+
```
167+
168+
b.4. Rename export.sqlite3 and replace the corrupted db.sqlite3.
169+
170+
b.5. If django-mdict is deployed in WSL, you also need to change the read and write permissions for db.sqlite3 in WSL.
171+
172+
```
173+
chmod 777 db.sqlite3
174+
```
143175

144176
23. django.db.utils.OperationalError: attempt to write a readonly database
145177

doc/doc_question.md

+34-2
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,43 @@ pip install -U django-js-asset
129129

130130
22. django.db.utils.DatabaseError: database disk image is malformed
131131

132+
以windows为例:
133+
132134
a. [下载sqlite工具](https://www.sqlite.org/download.html)
133135

134-
b. [修复db.sqlite3文件](https://blog.csdn.net/qq_41539778/article/details/136531120)
136+
a.1 下载sqlite-dll-win-x64-3460000.zip,解压到某个路径
137+
138+
a.2 将该路径加入到系统环境变量Path中
139+
140+
b. 修复db.sqlite3文件
141+
142+
b.1. 在cmd中cd到django-mdict根目录
143+
144+
b.2. 将损坏的db.sqlite3的内容导出到db.sql
145+
146+
```
147+
sqlite3 db.sqlite3
148+
.mode insert
149+
.output db.sql
150+
.dump
151+
.exit
152+
```
153+
b.3. 将db.sql导出为export.sqlite3
135154

136-
c. 将导出文件重命名为db.sqlite3.
155+
```
156+
sqlite3
157+
.open export.sqlite3
158+
.read db.sql
159+
.exit
160+
```
161+
162+
b.4. 将export.sqlite3重命名并替换损坏的db.sqlite3
163+
164+
b.5. 如果django-mdict部署在wsl中,还需在wsl中更改db.sqlite3的读写权限
165+
166+
```
167+
chmod 777 db.sqlite3
168+
```
137169

138170
23. django.db.utils.OperationalError: attempt to write a readonly database
139171

0 commit comments

Comments
 (0)