安装 git
准备好文件夹
E:\_prjct\boshi_xinxi_caiji\codes2
启动 git bash
$ pwd
/E/_prjct/boshi_xinxi_caiji/codes2
$ git clone https://gitee.com/xautstar/doctoral-dissertation-collection.git
创建数据库 collection,修改用户和密码
在sqlyog 中:
CREATE DATABASE collection2 DEFAULT CHARSET utf8 COLLATE utf8_general_ci;`collection2``collection2`
CREATE DATABASE tongxunlu DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
按住 shift 键,鼠标右键:
查看git状态
git status
git remote -v
pip install vertualenv
创建虚环境
python -m venv myvenv
[如果是linux环境: source bin/activate ]
PS E:\_prjct\boshi_xinxi_caiji\codes2\doctoral-dissertation-collection> cd .\myvenv\
PS E:\_prjct\boshi_xinxi_caiji\codes2\doctoral-dissertation-collection\myvenv> cd .\Scripts\
PS E:\_prjct\boshi_xinxi_caiji\codes2\doctoral-dissertation-collection\myvenv\Scripts> .\activate
(myvenv) PS E:\_prjct\boshi_xinxi_caiji\codes2\doctoral-dissertation-collection\myvenv\Scripts>
(myvenv) PS E:\_prjct\boshi_xinxi_caiji\codes2\doctoral-dissertation-collection\myvenv\Scripts> cd ..
(myvenv) PS E:\_prjct\boshi_xinxi_caiji\codes2\doctoral-dissertation-collection\myvenv> cd ..
(myvenv) PS E:\_prjct\boshi_xinxi_caiji\codes2\doctoral-dissertation-collection> ls
Directory: E:\_prjct\boshi_xinxi_caiji\codes2\doctoral-dissertation-collection
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 5/30/2022 10:02 PM .idea
d----- 5/30/2022 10:02 PM award
d----- 5/30/2022 10:02 PM basic_info
d----- 5/30/2022 10:02 PM DoctoralDissertationCollection
d----- 5/30/2022 10:31 PM myvenv
d----- 5/30/2022 10:02 PM patent
d----- 5/30/2022 10:02 PM static
d----- 5/30/2022 10:02 PM templates
d----- 5/30/2022 10:02 PM user
d----- 5/30/2022 10:02 PM utils
d----- 5/30/2022 10:02 PM __pycache__
-a---- 5/30/2022 10:02 PM 0 db.sqlite3
-a---- 5/30/2022 10:02 PM 671 manage.py
-a---- 5/30/2022 10:07 PM 1606 readme-cmd.txt
-a---- 5/30/2022 10:02 PM 876 README.md
-a---- 5/30/2022 10:02 PM 173 requirements.txt
python -m pip install --upgrade pip
pip install -r requirements.txt -i https://pypi.douban.com/simple
(myvenv) PS E:\_prjct\boshi_xinxi_caiji\codes2\doctoral-dissertation-collection> pip list
Package Version
--------------- -------
cffi 1.15.0
cryptography 37.0.2
cycler 0.11.0
Django 2.2.1
lxml 4.8.0
numpy 1.21.2
pip 22.1.1
pycparser 2.21
PyMySQL 1.0.2
python-dateutil 2.8.2
python-docx 0.8.11
pytz 2022.1
setuptools 56.0.0
six 1.16.0
sqlparse 0.4.1
xlrd 1.1.0
(myvenv) PS E:\_prjct\boshi_xinxi_caiji\codes2\doctoral-dissertation-collection> python .\manage.py runserver 8889
ModuleNotFoundError: No module named 'model_utils'
pip install django-model-utils -i https://pypi.douban.com/simple
(myvenv) PS E:\_prjct\boshi_xinxi_caiji\codes2\doctoral-dissertation-collection> python .\manage.py runserver 8889
AttributeError: 'str' object has no attribute 'decode'
http://127.0.0.1:8889/
生成迁移文件
python .\manage.py makemigrations
实施迁移
python .\manage.py migrate
http://127.0.0.1:8889/information/comment
http://127.0.0.1:8889/information/basic-information
http://127.0.0.1:8889/information/export
(myvenv) PS E:\_prjct\boshi_xinxi_caiji\codes2\doctoral-dissertation-collection> python .\manage.py dbshell
CommandError: You appear not to have the 'mysql' program installed or on your path.
========================================
Pycharm , Terminal:
> .\myvenv\Scripts\activate
> python .\manage.py runserver 8889
>python .\manage.py makemigrations
>python .\manage.py makemigrations --mergeg
>python .\manage.py migrate
> python .\manage.py runserver 8889
标签:10,Windows,代码,30,Django,2022,myvenv,boshi,PM From: https://www.cnblogs.com/emanlee/p/16328532.html