一、项目结构
二、初始化配置、工厂函数、表单等
- 编写配置文件:settings.py
- 拓展实例化:extensions.py
- 创建数据库模型:models.py
- 生成虚拟数据:fakes.py
- 构建__init__.py
- 新建.flaskenv文件
- 初步运行程序
- 定义博客表单:forms.py
- 辅助函数文件:utils.py
三、博客前台页面
- 基模板:base.html
- 文章列表显示局部模板:_post.html(templates/blog/_post.html)
- 博客主页Index.html和分页详情页category.html(templates/blog/xx.html)(bluemaps/blog.py)
- 文章详情页post.html(templates/blog/post.html)(bluemaps/blog.py)
- 登录页面和登出login.html(templates/blog/login.html)(bluemaps/login.py)
四、博客后台管理
- 文章管理
- 新增文章:new_post.html (templates/admin/new_post.html)(bluemaps/admin.py)
- 管理文章:manage_post.html (templates/admin/manage_post.html)(bluemaps/admin.py)
- 编辑文章:edit_post.html (templates/admin/edit_post.html)(bluemaps/admin.py)
- 上传图片设置:admin.py (bluemaps/admin.py)
- 博客设置:settings.html (templates/admin/settings.html)(bluemaps/admin.py)
- 评论管理:manage_comment.html (templates/admin/manage_comment.html)(bluemaps/admin.py)
- 分类管理
- 新增分类:new_category.html (templates/admin/new_category.html)(bluemaps/admin.py)
- 分类管理页面:manage_categroy.html (templates/admin/manage_categroy.html)(bluemaps/admin.py)
- 编辑分类:edit_category.html (templates/admin/edit_category.html)(bluemaps/admin.py)
- 删除分类: (Category模型类中添加delete()方法) (bluemaps/admin.py)