hsy77 b2a843ec09 | 4 years ago | ||
---|---|---|---|
bluelog | 删除 | 4 years ago | |
logs | 删除 | 4 years ago | |
migrations | 删除 | 4 years ago | |
pic | 删除 | 4 years ago | |
root/content | 删除 | 4 years ago | |
tests | 删除 | 4 years ago | |
uploads | 删除 | 4 years ago | |
.coveragerc | 4 years ago | ||
.flake8 | 4 years ago | ||
.flaskenv | 4 years ago | ||
.gitignore | 4 years ago | ||
LICENSE | 4 years ago | ||
Pipfile | 4 years ago | ||
Pipfile.lock | 4 years ago | ||
Procfile | 4 years ago | ||
Procfile.windows | 4 years ago | ||
README.md | 4 years ago | ||
content.rar | 4 years ago | ||
css.md | 4 years ago | ||
requirements.txt | 4 years ago | ||
wsgi.py | 4 years ago | ||
云计算项目.pptx | 4 years ago | ||
标题.png | 4 years ago |
使用镜像直接看第4步
云数据库以删除,需要新建(防止花费过高)
clone:
$ git clone https://github.com/hsy77/bluelog.git
$ cd bluelog
在云主机中安装依赖:
(这两步可不做,即不用创建虚拟环境)
$ python3 -m venv env
$ source env/bin/activate
(需要在云主机上或者虚拟环境中运行,两个环境都可以,为了保证psycopg2的安装不报错)
$ sudo yum install postgresql-libs -y
$ sudo yum install postgresql-devel -y
$ sudo yum install gcc -y
(安装需要的包)
$ pip3 install -r requirements.txt
生成数据并且运行:
$ flask forge #将数据导入数据表中
$ flask run -h 0.0.0.0 -p 80 #在0.0.0.0 80端口运行,为了使得使用外网ip可以访问
* Running on http://0.0.0.0:80/
接下来就可以在网页上输入云主机外网ip访问
Test account:
admin
helloflask
bluelog\bluelog\settings.py
中的以下四个参数改为自己数据库的设置生成数据并且运行:
$ flask forge #将数据导入数据表中
$ flask run -h 0.0.0.0 -p 80 #在0.0.0.0 80端口运行,为了使得使用外网ip可以访问
* Running on http://0.0.0.0:80/
接下来就可以在网页上输入云主机外网ip访问
Test account:
username: admin
password: helloflask