# 基于flask的博客系统搭建
- 1.部署的具体网址为http://www.unrealblue.xin/, 360安全浏览器和ie浏览器不兼容
- 2.下载代码到本地,先建立一个virtualenv坏境,我用的是pycharm软件,直接可以建立flask坏境,如下图所示:
![image](/blob/master/images/1.png)
- 3.激活virtualenv环境,`. venv/bin/activate`。安装所有requirements.txt中的模块,`pip install -r requirements.txt`。因为网络的原因可能会其中某几个会安装失败,多安装几次就好。
- 4.导入坏境变量,需要导入以下三个变量
* export MAIL_USERNAME=<your email@example.com>(开启了smtp服务的邮箱账号,程序里默认使用163邮箱,可以修改成其它类型邮箱)
* export MAIL_PASSWORD=<password>(不一定是你的邮箱密码,比如163邮箱开启smtp服务会让你设置一个密码,该密码即为password,qq邮箱开启smtp会提示给你一个密码)
* export FLASK_ADMIN=<admin email>(默认是管理者邮箱,用该邮箱创建账号就是管理者)
- 5.安装数据库迁移。输入以下命令
* `python manager.py db init` (使用init命令创建迁移仓库)
* `python manager.py db migrate -m "initial migration"`(migrate命令用来自动创建迁移脚本)
* `python manager.py db upgrade`(更新数据库,第一次使用该命令会新建一个数据库,可以利用pycharm右侧的Database查看该数据库)
- 6.部署程序,`python manager.py deploy`
- 7.在本地运行程序,`python manager.py runserver`打开http://127.0.0.1:5000端口查看, 按Ctrl+C退出程序。
## 实际运行的效果
![image](/blob/master/images/2.png)
![image](/blob/master/images/3.png)
![image](/blob/master/images/4.png)
![image](/blob/master/images/5.png)
免责声明:
1.本资源仅供学习和交流使用,不保证其准确性、完整性、及时性或适用性。
2.本资源仅包含一般信息,不构成专业建议。在使用本资源时,请务必自行研究并谨慎决策。
3.我已尽力确保本资源的正确性和合法性,但不对其准确性、完整性和及时性做出保证。
4.本资源不应用于商业用途。
5.在使用本资源的过程中,用户应自行承担所有风险和责任,并遵守相关法律法规。
6.对于因使用本资源而产生的任何损失或损害,我概不负责。
请确保在使用本资源时仔细阅读并遵守以上免责声明。如果您有任何疑问或需要进一步帮助,请联系我。
没有合适的资源?快使用搜索试试~ 我知道了~
基于python flask web框架的全栈项目, 前端重新设计, 写博客功能完全支持M-flask-blog.zip
共80个文件
py:25个
html:22个
css:7个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 172 浏览量
2024-01-31
20:24:28
上传
评论
收藏 1.37MB ZIP 举报
温馨提示
基于python flask web框架的全栈项目, 前端重新设计, 写博客功能完全支持M-flask-blog
资源推荐
资源详情
资源评论
收起资源包目录
基于python flask web框架的全栈项目, 前端重新设计, 写博客功能完全支持M-flask-blog.zip (80个子文件)
flask-blog-master
app
__init__.py 2KB
models.py 14KB
templates
register.html 756B
include
_navbar.html 2KB
_post.html 3KB
_header.html 84B
_comment.html 2KB
_macros.html 2KB
403.html 180B
followers.html 1KB
confirm.html 298B
upload.html 320B
moderate.html 358B
post.html 927B
unconfirmed.html 519B
edit_profile.html 353B
login.html 754B
404.html 189B
confirm.txt 171B
md_editor.html 2KB
base.html 2KB
index.html 1KB
user.html 3KB
blog.html 219B
edit_post.html 224B
api_1_0
__init__.py 158B
comments.py 2KB
posts.py 2KB
decorators.py 452B
users.py 2KB
authentication.py 2KB
errors.py 487B
decorators.py 608B
main
__init__.py 108B
views.py 10KB
forms.py 2KB
errors.py 1KB
static
jquery.dropdown.css 2KB
material.min.js 6KB
bootstrap-material-design.css.map 24KB
ripples.min.js.map 4KB
ripples.css 1KB
ripples.min.css.map 621B
site.css 2KB
bootstrap-material-design.css 107KB
bootstrap-material-design.min.css.map 33KB
ripples.js 7KB
material.js 13KB
material.min.js.map 6KB
index.js 50B
ripples.min.js 3KB
codehilite.css 3KB
bootstrap-material-design.min.css 93KB
ripples.css.map 2KB
ripples.min.css 1KB
jquery.dropdown.js 13KB
auth
__init__.py 106B
views.py 3KB
forms.py 1KB
config 35B
email.py 925B
tests
__init__.py 0B
test_api.py 2KB
test_basic.py 584B
test_selenium.py 2KB
test_client.py 2KB
.idea
vcs.xml 180B
inspectionProfiles
Project_Default.xml 502B
profiles_settings.xml 235B
modules.xml 264B
Procfile 25B
requirements.txt 887B
manager.py 2KB
images
3.png 491KB
1.png 396KB
5.png 196KB
4.png 128KB
2.png 323KB
README.md 2KB
config.py 2KB
共 80 条
- 1
资源评论
武昌库里写JAVA
- 粉丝: 3220
- 资源: 1925
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功