SSss
This commit is contained in:
2
flask框架网址
Normal file
2
flask框架网址
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
flask框架
|
||||||
|
http://docs.jinkan.org/docs/flask/quickstart.html#a-minimal-application
|
||||||
17
linux数据库操作
Normal file
17
linux数据库操作
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
linux数据库操作
|
||||||
|
mysql -uroot -p
|
||||||
|
数据库密码:123456
|
||||||
|
创建数据表
|
||||||
|
数据库名:food_db
|
||||||
|
CREATE DATABASE `food_db` DEFAULT CHARACTER SET = `utf8mb4`;
|
||||||
|
查看表
|
||||||
|
show databases;
|
||||||
|
进入数据表
|
||||||
|
use food_db;
|
||||||
|
show tables;
|
||||||
|
select * from user ;
|
||||||
|
show create table user;
|
||||||
|
|
||||||
|
|
||||||
|
1. 开启mysql service mysqld start
|
||||||
|
2. 查看mysql是否开启 ps -ef |grep mysql
|
||||||
88
启动服务
88
启动服务
@@ -1,60 +1,5 @@
|
|||||||
进入目录 cd imooc_env/
|
|
||||||
开启虚拟环境 source bin/activate
|
|
||||||
source imooc_env/bin/activate
|
|
||||||
|
|
||||||
开启共享目录: mount -t vboxsf mooc /home/www
|
|
||||||
cd /home/www
|
|
||||||
ls
|
|
||||||
|
|
||||||
运行helloword
|
|
||||||
如果在虚拟环境中打开浏览器不让访问,则需要关闭防火墙
|
|
||||||
service firewalld stop
|
|
||||||
|
|
||||||
python hello.py
|
|
||||||
192.168.31.107:5000
|
|
||||||
192.168.31.107:5000/imooc/hello
|
|
||||||
可以看到页面有内容输出
|
|
||||||
//使用本地测试环境
|
|
||||||
export ops_config=local&&python manager.py runserver
|
|
||||||
|
|
||||||
postman本地环境测试接口
|
|
||||||
192.168.31.106:8999/user/login
|
|
||||||
http://192.168.31.105:8998/api/food/inde
|
|
||||||
|
|
||||||
http://192.168.31.105:8998/api/member/logintwo
|
|
||||||
|
|
||||||
http://106.52.204.179/api/food/index
|
|
||||||
|
|
||||||
http://192.168.31.105:8999/api/member/deviceinfo
|
|
||||||
线上服务器接口
|
|
||||||
http://106.52.204.179:8999/user/login
|
|
||||||
http://106.52.204.179:8999/api/member/logintwo
|
|
||||||
|
|
||||||
http://106.52.204.179:8999/api/food/index
|
|
||||||
|
|
||||||
http://106.52.204.179:8999/api/member/deviceinfo
|
|
||||||
linux数据库操作
|
|
||||||
mysql -uroot -p
|
|
||||||
数据库密码:123456
|
|
||||||
创建数据表
|
|
||||||
数据库名:food_db
|
|
||||||
CREATE DATABASE `food_db` DEFAULT CHARACTER SET = `utf8mb4`;
|
|
||||||
查看表
|
|
||||||
show databases;
|
|
||||||
进入数据表
|
|
||||||
use food_db;
|
|
||||||
show tables;
|
|
||||||
select * from user ;
|
|
||||||
show create table user;
|
|
||||||
|
|
||||||
flask框架
|
|
||||||
http://docs.jinkan.org/docs/flask/quickstart.html#a-minimal-application
|
|
||||||
1. 开启mysql service mysqld start
|
|
||||||
2. 查看mysql是否开启 ps -ef |grep mysql
|
|
||||||
|
|
||||||
腾讯云mysql密码:~renjianbo0118mysql*&;
|
腾讯云mysql密码:~renjianbo0118mysql*&;
|
||||||
|
|
||||||
|
|
||||||
线上服务器操作
|
线上服务器操作
|
||||||
xhell连接腾讯云:
|
xhell连接腾讯云:
|
||||||
ssh root@106.52.204.179 密码:~renjianbo0118 用户名:root
|
ssh root@106.52.204.179 密码:~renjianbo0118 用户名:root
|
||||||
@@ -78,37 +23,4 @@ export ops_config=local&&python manager.py runserver
|
|||||||
http://127.0.0.1:9000/
|
http://127.0.0.1:9000/
|
||||||
|
|
||||||
|
|
||||||
停服务
|
|
||||||
service nginx stop
|
|
||||||
killall -s INT /data/www/python3_vir/bin/uwsgi
|
|
||||||
开服务
|
|
||||||
source /data/www/python3_vir/bin/activate
|
|
||||||
cd /data/www/python3_vir
|
|
||||||
source bin/activate
|
|
||||||
cd /data/www/order
|
|
||||||
export ops_config=production&&python manager.py runserver
|
|
||||||
uwsgi --ini uwsgi.ini
|
|
||||||
cd /data/www/logs
|
|
||||||
tail -f order.log (查看服务启起来了)
|
|
||||||
ps -ef |grep uwsgi(查看多进程)
|
|
||||||
|
|
||||||
cd /etc/nginx/conf.d
|
|
||||||
service nginx start
|
|
||||||
ps -ef |grep nginx(查看ng启动起来了)
|
|
||||||
service nginx reload
|
|
||||||
|
|
||||||
https://python815.cn/user/login
|
|
||||||
http://python815.cn/user/login
|
|
||||||
https://www.python815.cn/user/login
|
|
||||||
http://www.python815.cn/user/login
|
|
||||||
http://106.52.204.179/user/login
|
|
||||||
账号:54php.cn 密码123456789
|
|
||||||
账号:吃货:密码:123456
|
|
||||||
账号:54php.cn2 密码:123456
|
|
||||||
账号:猪猪侠2 密码:123456789
|
|
||||||
卸载mysql
|
|
||||||
https://blog.csdn.net/li_wei_quan/article/details/78549891
|
|
||||||
|
|
||||||
线上测试api
|
|
||||||
http://106.52.204.179/api/food/index
|
|
||||||
|
|
||||||
|
|||||||
33
启动线上服务器
Normal file
33
启动线上服务器
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
停服务
|
||||||
|
service nginx stop
|
||||||
|
killall -s INT /data/www/python3_vir/bin/uwsgi
|
||||||
|
开服务
|
||||||
|
source /data/www/python3_vir/bin/activate
|
||||||
|
cd /data/www/python3_vir
|
||||||
|
source bin/activate
|
||||||
|
cd /data/www/order
|
||||||
|
export ops_config=production&&python manager.py runserver
|
||||||
|
uwsgi --ini uwsgi.ini
|
||||||
|
cd /data/www/logs
|
||||||
|
tail -f order.log (查看服务启起来了)
|
||||||
|
ps -ef |grep uwsgi(查看多进程)
|
||||||
|
|
||||||
|
cd /etc/nginx/conf.d
|
||||||
|
service nginx start
|
||||||
|
ps -ef |grep nginx(查看ng启动起来了)
|
||||||
|
service nginx reload
|
||||||
|
|
||||||
|
https://python815.cn/user/login
|
||||||
|
http://python815.cn/user/login
|
||||||
|
https://www.python815.cn/user/login
|
||||||
|
http://www.python815.cn/user/login
|
||||||
|
http://106.52.204.179/user/login
|
||||||
|
账号:54php.cn 密码123456789
|
||||||
|
账号:吃货:密码:123456
|
||||||
|
账号:54php.cn2 密码:123456
|
||||||
|
账号:猪猪侠2 密码:123456789
|
||||||
|
卸载mysql
|
||||||
|
https://blog.csdn.net/li_wei_quan/article/details/78549891
|
||||||
|
|
||||||
|
线上测试api
|
||||||
|
http://106.52.204.179/api/food/index
|
||||||
15
启动线下服务器
Normal file
15
启动线下服务器
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
进入目录 cd imooc_env/
|
||||||
|
开启虚拟环境 source bin/activate
|
||||||
|
source imooc_env/bin/activate
|
||||||
|
开启共享目录: mount -t vboxsf mooc /home/www
|
||||||
|
cd /home/www
|
||||||
|
ls
|
||||||
|
运行helloword
|
||||||
|
如果在虚拟环境中打开浏览器不让访问,则需要关闭防火墙
|
||||||
|
service firewalld stop
|
||||||
|
python hello.py
|
||||||
|
192.168.31.107:5000
|
||||||
|
192.168.31.107:5000/imooc/hello
|
||||||
|
可以看到页面有内容输出
|
||||||
|
//使用本地测试环境
|
||||||
|
export ops_config=local&&python manager.py runserver
|
||||||
10
建表
10
建表
@@ -30,5 +30,15 @@ create TABLE `user` (
|
|||||||
在orderr目录下输入
|
在orderr目录下输入
|
||||||
flask-sqlacodegen " mysql://root:~renjianbo0118mysql*&;@127.0.0.1/food_db" --tables deviceinfo --outfile "common/models/member/DeviceInfo.py" --flask
|
flask-sqlacodegen " mysql://root:~renjianbo0118mysql*&;@127.0.0.1/food_db" --tables deviceinfo --outfile "common/models/member/DeviceInfo.py" --flask
|
||||||
|
|
||||||
|
自动生成modles
|
||||||
|
flask-sqlacodegen " mysql://root:123456@127.0.0.1/food_db" --tables membermiya --outfile "common/models/member/Membermiya.py" --flask
|
||||||
|
flask-sqlacodegen " mysql://root:123456@127.0.0.1/food_db" --tables member --outfile "common/models/member/Member.py" --flask
|
||||||
|
flask-sqlacodegen " mysql://root:123456@127.0.0.1/food_db" --tables oauth_member_bind --outfile "common/models/member/Oauth_member_bind.py" --flask
|
||||||
|
flask-sqlacodegen " mysql://root:123456@127.0.0.1/food_db" --tables mendianusertwo --outfile "common/models/Mendianusertwo.py" --flask
|
||||||
|
flask-sqlacodegen " mysql://root:123456@127.0.0.1/food_db" --tables mendianuserinfo --outfile "common/models/member/Mendianuserinfo.py" --flask
|
||||||
|
flask-sqlacodegen " mysql://root:123456@127.0.0.1/food_db" --tables deviceinfo --outfile "common/models/member/DeviceInfo.py" --flask
|
||||||
|
flask-sqlacodegen " mysql://root:~renjianbo0118mysql*&;@127.0.0.1/food_db" --tables deviceinfo --outfile "common/models/member/DeviceInfo.py" --flask
|
||||||
|
|
||||||
|
|
||||||
3.修改自动生成的model中的db变量 (很重要)
|
3.修改自动生成的model中的db变量 (很重要)
|
||||||
from application import db
|
from application import db
|
||||||
21
验证线上服务器接口
Normal file
21
验证线上服务器接口
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
线上服务器接口
|
||||||
|
http://106.52.204.179:8999/user/login
|
||||||
|
http://106.52.204.179:8999/api/member/logintwo
|
||||||
|
|
||||||
|
http://106.52.204.179:8999/api/food/index
|
||||||
|
|
||||||
|
http://106.52.204.179:8999/api/member/deviceinfo
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
线下服务器接口
|
||||||
|
postman本地环境测试接口
|
||||||
|
192.168.31.106:8999/user/login
|
||||||
|
http://192.168.31.105:8998/api/food/inde
|
||||||
|
|
||||||
|
http://192.168.31.105:8998/api/member/logintwo
|
||||||
|
|
||||||
|
http://106.52.204.179/api/food/index
|
||||||
|
|
||||||
|
http://192.168.31.105:8999/api/member/deviceinfo
|
||||||
Reference in New Issue
Block a user