00. environment to build (Fresh Project)

The first step: python virtual environment module Introduction

https://www.cnblogs.com/jiangzongyou/p/11962804.html

Step Two: Project to build

1. Install the virtual environment, specify python36

mkvirtualenv -p C:\Python36\python36.exe VueShop

2. VueShop virtual environment, install django 1.11.3, due to the native address too slow, used here watercress mirror address

pip install django==1.11.3 -i https://pypi.douban.com/simple

3. Vu eShop virtual environment, installationdjangorestframework  https://www.django-rest-framework.org/

pip install djangorestframework
pip install markdown django-filter

4. Use pycharm new projects MxShop, and specify the virtual environment, do not check the admin! !

 

 5. Start project, to verify whether it is normal to start

 

 6. Configuration Database file section settings.py

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': "mxshop",
'USER': "root",
'PASSWORD': "",
'HOST': "127.0.0.1",
'PORT': 3306,
# 这里指定一下存储引擎
'OPTIONS': {"init_command": "SET storage_engine=INNODB;"},
}
}

7. 在VueShop虚拟环境中,安装mysql驱动

(如果安装失败,那就去 https://www.lfd.uci.edu/~gohlke/pythonlibs/#pycurl 下载对应的包,用 ”pip install 该包的绝对路径” 来安装)

(scripy框架安装时,也很容易出现Lxml包安装失败的情况,也可以按上面方法手动安装)

pip install mysqlclient

8. 在VueShop虚拟环境中,安装图像处理模块 pillow

pip install pillow -i https://pypi.douban.com/simple

9 . 配置基本结构

 

 

 

 

-----  完美的分割线  -----

Guess you like

Origin www.cnblogs.com/jiangzongyou/p/12054473.html