1.sudo apt-get install nginx
2.sudo apt-get install mysql-server
3.查看进程 ps aux|grep mysql
4.vi /etc/mysql/mysql.conf.d/mysqld.cnf bind-address = 127.0.0.1 windows 改为 0.0.0.0
5.sudo service mysql restart
6.GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION; FLUSH PRIVILEGES;
7.windows 数据库远程连接 云服务器 看收藏夹部署教程
8.安装pip ,pip install virtualenv pip install virtualenvwrapper
9.vi ~/.barshrc ->
export WORKON_HOME=$HOME/ .virtualenvs
export PROJECT_HOME=$HOME/worksapce
source /usr/local/bin/virtualenvwrapper.sh
10.source ~/.bashrc
11. mkvirtualenv notes
12. pip freeze > requirements.txt
13.pip install -r requirements.txt
django==1.9.8
django-crispy-forms==1.6.1
django-formtools==1.0
django-pure-pagination==0.3.0
django-simple-captcha==0.4.6
httplib2==0.9.2
MySQL-python==1.2.5
olefile==0.43
Pillow==4.0.0
six==1.10.0
14.报错时 sudo apt-get install libmysqlclient-dev
15.单独快速安装 pip install -i https://pypi.douban.com/simple pillow==4.0.0
16. pip install uwsgi
17. uwsgi --http :8000 -moudle record.wsgi
18. 拉取所有static file 到同一个目录 STATIC_ROOT = os.path.join(BASE_DIR, "static") python manage.py collectstatic
19. 自动重启 uwsgi -> pkill -f uwsgi
20. 增加nginx 权限 vi /etc/nginx/nginx.conf 第一行 www-data 改为 root
21. systemctl start nginx 有权限问题 pkill -f nginx 再 nginx重启
22.vi /etc/nginx/conf.d/uc_nginx.conf 静态文件代理在这个下面 样式显示不出来
23.pythonanywhere 部署
1. git clone https://github.com/xueleilei120/record.git
2. git pull
3. cd record
4. virtualenv --python=python2.7 venv2 source /home/liuyc2/.virtualenvs/env2/bin
5. pip install -r requirements.txt
6.mysql
1.use xionger$record;
2.source /home/xionger/record/record.sql
7.拉取所有static file 到同一个目录 STATIC_ROOT = os.path.join(BASE_DIR, "static") python manage.py collectstatic
8.查看虚拟环境下的软件版本 pip list
24. 创建指定python版本的虚拟环境 E:\virtualevn>mkvirtualenv --python=C:\Python27\python.exe OnlineNotes2