Git Product home page Git Product logo

weblog's Introduction

Weblog

Flask Web 应用「个人博客」。基于 Flask 1.0 编写,主要实现了以下功能:

  • 注册、登录

  • 邮箱验证

  • 个人主页

  • 更换邮箱

  • 修改密码

  • 编辑个人信息

  • 编写博客

  • 评论博客

  • 关注他人

  • 管理员管理评论

环境要求

操作系统:Ubuntu 14.04+

编程语言:Python 3.5+

开发框架:Flask 1.0+

数据库:MySQL 8.0+

部署流程

创建虚拟环境,在项目主目录下执行如下操作。

0、安装项目所需第三方库:

$ pip install --no-use-pep517 -r requirements.txt

需要将 <b>{{field.label.text|safe}}</b> 写入 flask_bootstrap.templates.bootstrap.wtf.html 文件的 RadioField 部分的 for 循环前面。

1、创建数据库:

$ mysql -uroot -e 'CREATE SCHEMA weblog'

2、配置环境变量:

$ export FLASK_DEBUG=1 FLASK_APP=manage.py
$ export MAIL_PASSWORD=asdfasdf  [email protected]
$ export MYSQL_PWD=xxxx [email protected]

3、创建数据表:

$ flask db upgrade

4、生成测试数据:

$ python -m scripts.generate_fake_data

5、测试

$ pytest

6、启动应用,方式有多种:

$ flask run                                 # Flask 启动
$ gunicorn -c etc/gunicorn.py manage:app    # Gunicorn 启动
$ supervisord -c etc/supervisord.conf       # Supervisor 启动

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.