1、下载并安装WebStorm
下载链接:https://www.jetbrains.com/webstorm/

2、下载并安装PyCharm (专业版)
下载链接:https://www.jetbrains.com/pycharm/download/#section=mac

3、下载并安装python3
下载链接:https://www.python.org/downloads/

打开终端,查看python3是否安装成功

命令:python3

显示:Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 03:03:55)

4、clone代码
http://git.sankuai.com/projects/PAYRC/repos/velen_mis/browse 中的代码clone到指定位置。

命令:git clone http://[email protected]/scm/payrc/velen_mis.git

5、用PyCharm打开工程目录
修改三个配置:

本地启动SOP
本地启动SOP
本地启动SOP
然后直接点击run/debug按钮或在命令行执行:manage.py runserver 8000

6、安装pip3
1)、打开链接:https://bootstrap.pypa.io/get-pip.py ,将该链接另存为get-pip.py。

2)、运行get-pip.py:python3 get-pip.py

3)、显示Successfully installed pip-10.0.1即可

7、通过pip3安装python依赖
pip3 install Django==1.11.1 –trusted-host pip.sankuai.com
pip3 install uwsgi –trusted-host pip.sankuai.com
pip3 install pymysql –trusted-host pip.sankuai.com
pip3 install pycrypto –trusted-host pip.sankuai.com
pip3 install mssapi –trusted-host pip.sankuai.com
pip3 install py2neo –trusted-host pip.sankuai.com
pip3 install neo4j-driver –trusted-host pip.sankuai.com
pip3 install kazoo==2.2.0 –trusted-host pip.sankuai.com
pip3 install simplejson –trusted-host pip.sankuai.com
pip3 install requests –trusted-host pip.sankuai.com
pip3 install xlrd –trusted-host pip.sankuai.com

8、用webstorm打开前端工程目录
将static目录用webstorm打开

9、安装npm和cnpm
1)、npm:

命令:curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.1/install.sh | bash
nvm install 8.0
2)、cnpm:

命令:npm install -g cnpm –registry=https://registry.npm.taobao.org

10、安装nginx
1)、利用Homebrew安装nginx(比较方便快捷)

打开终端,命令:brew install nginx
本地启动SOP

2)、配置nginx

location ~ /api/ {
proxy_pass http://127.0.0.1:8000;
}
location ~ / {
proxy_pass http://127.0.0.1:8080;

}

3)、检查nginx配置文件是否正确 命令:nginx -t

4)、命令:sudo nginx 启动nginx

5)、查看nginx是否启动成功 命令:sudo lsof -i:80

11、更改hosts文件
通过vim打开hosts文件 命令:vim /etc/hosts

添加一行映射

12、启动
以上均安装配置完成之后,在webstorm的terminal运行

命令:cnpm install //根据package.json安装依赖

cnpm run build //根据webpack.config.js打包编译

cnpm run dev //运行开发环境

相关文章:

  • 2022-12-23
  • 2022-01-04
  • 2021-08-23
  • 2021-05-18
  • 2021-11-15
  • 2021-09-04
  • 2022-12-23
猜你喜欢
  • 2022-01-06
  • 2021-10-01
  • 2021-10-13
  • 2021-06-12
  • 2021-07-10
  • 2022-12-23
相关资源
相似解决方案