- This is just a web system developed based on flask.
- Designed by yangxir.
- Based on the basic knowledge learned from the qa project of Zhiliao Chuanke, expand the development.
- Original Unexpanded Project Go to https://github.com/yangxir/-qa-
- python3.7+
- MySQL
- FLask
-
Modify the information in
config.py
, including mailbox, database, etc. -
Install dependencies (some dependency packages are not added completely, you need to find them yourself):
$ pip install -r requirements.txt
- Database migration. First delete the migrations folder, then enter the project file and run the following three commands:
$flask db init
$flask db migrate
$flask db upgrade
- (You need to add the account
admin
passwordadmin
in theadmin
table first). - (You need to add id
113
usernameadmin
and password tousermodel
table, others are optional)
├ Readme.md // Help document
├ app.py // Flask initialization file
├ config.py // Configuration file
├ decorators.py // Decorator (login detection)
├ dirtree.txt // Directory tree
├ exts.py // Tool class initialization
├ models.py // Database model
├ requirements.txt // Lists all dependent packages and version numbers to facilitate generating the same virtual environment and dependencies in other locations
├ utils.py // Tool function
├─blueprints // Blueprint (view)
│ ├─admin // Administrator blueprint
│ ├─competition // Competition blueprint
│ ├─forms // Form blueprint
│ ├─learn // Learning video blueprint
│ ├─qa // Question blueprint
│ ├─questionnaire // Questionnaire blueprint
│ └─user // User blueprint (no longer used)
├─migrations // Database migration folder
├─static // CSS, JS, pictures and other static files
└─templates // Jinja2 template folder
- New feature: You can enter the personal center to edit and view your own comments, questions, and questionnaires.
- New feature: Administrators can view the answers to the questionnaire.
- New feature: Video open comment area.
- Pagination query function.
- Fix the pagination query code bug. Some python versions cannot use .pagination
- Fix the problem that the search question page does not use the pagination query function.
- New features: Add web icon AI, favicon.ico.
- Modify the URL navigation bar title.
- The video name becomes unique
- Fixed the problem that deleting a questionnaire cannot delete the questions, options, and answers in the questionnaire.
- Fixed the problem that deleting a video cannot delete the comments of the video.
- Fixed the problem that deleting a user cannot delete the questions, answers, and questionnaires posted by the user.
- Fixed the problem that deleting a question cannot delete the answer to the question.
- 这只是一款基于flask开发的网页系统。
- yangxir设计。
- 基于知了传课的qa项目学习的基础知识,进行扩展开发。
- 原 未扩展项目 转到 https://github.com/yangxir/-qa-
- python3.7+
- MySQL
- FLask
-
修改
config.py
中的信息,包括邮箱、数据库等 -
安装依赖(有依赖包没有加完全,需要自己查找):
$ pip install -r requirements.txt
- 数据库迁移。先删除 migrations 文件夹,然后进入项目文件运行以下三个指令:
$flask db init
$flask db migrate
$flask db upgrade
- (需要先在
admin
表中添加账户admin
密码admin
)。 - (需要在
usermodel
表中添加 id113
usernameadmin
密码随意,其他随意)
├ Readme.md // 帮助文档
├ app.py // Flask 初始化文件
├ config.py // 配置文件
├ decorators.py // 装饰器(登陆检测)
├ dirtree.txt // 目录树
├ exts.py // 工具类初始化
├ models.py // 数据库模型
├ requirements.txt // 列出了所有依赖包以及版本号,方便在其他位置生成相同的虚拟环境以及依赖
├ utils.py // 工具函数
├─blueprints // 蓝图(视图)
│ ├─admin // 管理员蓝图
│ ├─competition // 竞赛蓝图
│ ├─forms // 表单蓝图
│ ├─learn // 学习视频蓝图
│ ├─qa // 问题蓝图
│ ├─questionnaire // 问卷蓝图
│ └─user // 用户蓝图(已不使用)
├─migrations // 数据库迁移文件夹
├─static // CSS、JS、图片等静态文件
└─templates // Jinja2 模板文件夹
- 新增功能:个人中心可以进入,编辑、查看自己的评论、问题、问卷。
- 新增功能:管理员可以查看问卷回答情况。
- 新增功能:视频开放评论区。
- 分页查询功能。
- 修复分页查询代码bug,一些python版本中无法使用.pagination
- 修复搜搜问题页面没有使用分页查询功能。
- 新增功能:增加网页图标AI,favicon.ico。
- 修改网址导航栏标题。
- 视频名称变为唯一
- 修复删除调查问卷不能删除问卷中的问题、选项、回答。
- 修复删除视频不能删除视频的评论。
- 修复删除用户不能删除用户发布的问题、回答、调查问卷。
- 修复删除问题不能删除问题的回答。