python+flask搭建个人博客2---项目结构及初始化

一、项目结构

二、初始化配置、工厂函数、表单等

  1. 编写配置文件:settings.py
  2. 拓展实例化:extensions.py
  3. 创建数据库模型:models.py
  4. 生成虚拟数据:fakes.py
  5. 构建__init__.py
  6. 新建.flaskenv文件
  7. 初步运行程序
  8. 定义博客表单:forms.py
  9. 辅助函数文件:utils.py

三、博客前台页面

  1. 基模板:base.html
  2. 文章列表显示局部模板:_post.html(templates/blog/_post.html)
  3. 博客主页Index.html和分页详情页category.html(templates/blog/xx.html)(bluemaps/blog.py)
  4. 文章详情页post.html(templates/blog/post.html)(bluemaps/blog.py)
  5. 登录页面和登出login.html(templates/blog/login.html)(bluemaps/login.py)

四、博客后台管理

  1. 文章管理
    • 新增文章: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)
  2. 博客设置:settings.html (templates/admin/settings.html)(bluemaps/admin.py)
  3. 评论管理:manage_comment.html (templates/admin/manage_comment.html)(bluemaps/admin.py)
  4. 分类管理
    • 新增分类: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)
       
posted @ 2021-01-28 11:59  时间都去哪儿了哈  阅读(144)  评论(0编辑  收藏  举报