GithubHelp home page GithubHelp logo

hhy5277 / flask-blog Goto Github PK

View Code? Open in Web Editor NEW

This project forked from happyte/flask-blog

0.0 2.0 0.0 11.89 MB

📒基于python flask web框架的全栈项目, 前端重新设计, 写博客功能完全支持Markdown所有特性

Home Page: www.unrealblue.xin

Python 46.09% CSS 6.96% JavaScript 27.44% HTML 19.51%

flask-blog's Introduction

基于flask的博客系统搭建

  • 1.部署的具体网址为http://www.unrealblue.xin/, 360安全浏览器和ie浏览器不兼容
  • 2.下载代码到本地,先建立一个virtualenv坏境,我用的是pycharm软件,直接可以建立flask坏境,如下图所示: image
  • 3.激活virtualenv环境,. venv/bin/activate。安装所有requirements.txt中的模块,pip install -r requirements.txt。因为网络的原因可能会其中某几个会安装失败,多安装几次就好。
  • 4.导入坏境变量,需要导入以下三个变量
    • export MAIL_USERNAME=<your [email protected]>(开启了smtp服务的邮箱账号,程序里默认使用163邮箱,可以修改成其它类型邮箱)
    • export MAIL_PASSWORD=(不一定是你的邮箱密码,比如163邮箱开启smtp服务会让你设置一个密码,该密码即为password,qq邮箱开启smtp会提示给你一个密码)
    • export FLASK_ADMIN=(默认是管理者邮箱,用该邮箱创建账号就是管理者)
  • 5.安装数据库迁移。输入以下命令
    • python manager.py db init (使用init命令创建迁移仓库)
    • python manager.py db migrate -m "initial migration"(migrate命令用来自动创建迁移脚本)
    • python manager.py db upgrade(更新数据库,第一次使用该命令会新建一个数据库,可以利用pycharm右侧的Database查看该数据库)
  • 6.部署程序,python manager.py deploy
  • 7.在本地运行程序,python manager.py runserver打开http://127.0.0.1:5000端口查看, 按Ctrl+C退出程序。

实际运行的效果

image

image

image

image

flask-blog's People

Contributors

happyte avatar zs511129 avatar

Watchers

 avatar  avatar

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.