zoukankan      html  css  js  c++  java
  • 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)
         
  • 相关阅读:
    Hibernate学习笔记1.2(Annotation版本的Helloworld)
    Hibernate学习笔记1.1(简单插入数据)
    Java 分页与原理(上)
    触发器实例讲解
    URLRewrite 实现方法详解
    一个数组:1,1,2,3,5,8,13,21...+m,求第30位数是多少?用递归实现;(常考!!!)
    面向对象
    ajax 判断账户密码 调取数据模糊查询 时钟
    asp.net 类,接口
    asp.net get图
  • 原文地址:https://www.cnblogs.com/ybbybb/p/14339038.html
Copyright © 2011-2022 走看看