V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
leetao94
V2EX  ›  Python

开源一个博客系统 - Peach-blog 用 flask 开发的

  •  3
     
  •   leetao94 ·
    lt94 · 2018-12-04 16:27:26 +08:00 · 2652 次点击
    这是一个创建于 1962 天前的主题,其中的信息可能已经有所发展或是发生改变。

    项目地址: https://github.com/lt94/peach-blog.git

    Peach-Blog

    开发这个目的就是,方便自己可以在 hexo 搭建的静态博客来回切换

    Features

    1. support export hexo's posts into database
    2. support export database's posts into hexo-format markdown file
    3. add new dashboard base on flask-admin
    4. add markdown support to flask-admin

    Screenshots

    Usages

    environment

    pip install -r requirements.txt
    

    init database

    before you execute following lines,make sure you have already create database

    flask shell
    

    you'are supposed to see, something like follow one:

    Python 3.6.5
    App: app [development]
    Instance: path\to\instance
    

    then

    >>> from app import db
    >>> db.create_all()
    # create super user
    >>> from app.models import User
    >>> user = User(user_name='your name',password='your password', level=1)
    >>> db.session.add(user)
    >>> db.session.commit()
    

    export hexo's posts into database

    if you want to export hexo posts into database, change the value of config.py on line 14 (where the hexo's posts store),then

    flask hexo g 
    

    clean the posts,just use flask hexo c simplely

    run the server

    flask run
    

    export database's posts into hexo-format markdown files

    login in peach-blog admin, and step into post list pages, and then (see the picture)

    the expoted post will generate under the directory where you set in config.py

    About Dev

    测试网址: http://132.232.71.126 测试账户: test/test, 没有修改,新增权限

    还有命令行导出功能,rss 等功能待开发

    17 条回复    2018-12-05 16:31:16 +08:00
    tulanxiaoxin
        1
    tulanxiaoxin  
       2018-12-04 16:45:29 +08:00
    文章的字是真的大
    xi2008wang
        2
    xi2008wang  
       2018-12-04 16:47:44 +08:00
    不错
    leetao94
        3
    leetao94  
    OP
       2018-12-04 16:52:30 +08:00
    @tulanxiaoxin 怕看不清楚,哈哈😄
    leetao94
        4
    leetao94  
    OP
       2018-12-04 16:52:41 +08:00
    @xi2008wang 谢谢~哈哈
    liuxu
        5
    liuxu  
       2018-12-04 16:56:58 +08:00
    哈哈,右边的小球很好玩
    hlwjia
        6
    hlwjia  
       2018-12-04 16:57:47 +08:00
    支持
    leetao94
        7
    leetao94  
    OP
       2018-12-04 16:58:44 +08:00
    @liuxu 特意找的插件~O(∩_∩)O
    leetao94
        8
    leetao94  
    OP
       2018-12-04 16:58:53 +08:00
    @hlwjia 谢谢~
    QQ2171775959
        9
    QQ2171775959  
       2018-12-04 17:07:15 +08:00
    有点详细,还配有图表。
    www5070504
        10
    www5070504  
       2018-12-04 17:07:32 +08:00
    m 感觉很不错
    shuizhengqi
        11
    shuizhengqi  
       2018-12-04 17:10:32 +08:00
    不是想打击你。。你这个样式,真的是见得好多,而且最上面的导航栏是 bootstrap 的样式吧
    leetao94
        12
    leetao94  
    OP
       2018-12-04 17:12:52 +08:00
    @shuizhengqi 是的~flask-bootstrap~
    leetao94
        13
    leetao94  
    OP
       2018-12-04 17:13:02 +08:00
    @www5070504 感谢支持
    mrrobot97
        14
    mrrobot97  
       2018-12-05 11:18:36 +08:00
    买个域名吧
    leetao94
        15
    leetao94  
    OP
       2018-12-05 11:28:11 +08:00
    @mrrobot97 之前在阿里云买了域名备案了,现在是腾讯云的服务器,还得接入备案~~好麻烦 0.0
    mrrobot97
        16
    mrrobot97  
       2018-12-05 15:57:05 +08:00
    @leetao94 所以博客我觉得还是搭建在国外的服务器比较好,国内备案后想写点什么翻墙的都不行。
    leetao94
        17
    leetao94  
    OP
       2018-12-05 16:31:16 +08:00
    @mrrobot97 国外的有时候访问速度挺慢的~
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1179 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 18:16 · PVG 02:16 · LAX 11:16 · JFK 14:16
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.