Giter Site home page Giter Site logo

peach-blog's Introduction

Peach-Blog

Build Status codecov

Peach Blog 是基于 Flask 的博客平台,目的是为了提供一种更加纯粹的内容写作与发布平台,通过几个简单命令,可以帮助用户无痛的从 Hexo 切换到 Peach Blog

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

create log dir

mkdir logs

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

欢迎各种 PR.

peach-blog's People

Contributors

dependabot[bot] avatar hello-katie avatar leetaogoooo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

peach-blog's Issues

flask shell报错,请问如何解决?

$ flask shell
Traceback (most recent call last):
File "c:\programdata\anaconda3\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "c:\programdata\anaconda3\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\ProgramData\Anaconda3\Scripts\flask.exe_main
.py", line 7, in
File "c:\programdata\anaconda3\lib\site-packages\flask\cli.py", line 966, in main
cli.main(prog_name="python -m flask" if as_module else None)
File "c:\programdata\anaconda3\lib\site-packages\flask\cli.py", line 586, in main
return super(FlaskGroup, self).main(*args, **kwargs)
File "c:\programdata\anaconda3\lib\site-packages\click\core.py", line 717, in main
rv = self.invoke(ctx)
File "c:\programdata\anaconda3\lib\site-packages\click\core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "c:\programdata\anaconda3\lib\site-packages\click\core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "c:\programdata\anaconda3\lib\site-packages\click\core.py", line 555, in invoke
return callback(*args, **kwargs)
File "c:\programdata\anaconda3\lib\site-packages\click\decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "c:\programdata\anaconda3\lib\site-packages\flask\cli.py", line 425, in decorator
with _ctx.ensure_object(ScriptInfo).load_app().app_context():
File "c:\programdata\anaconda3\lib\site-packages\flask\cli.py", line 392, in load_app
app = locate_app(self, import_name, None, raise_if_not_found=False)
File "c:\programdata\anaconda3\lib\site-packages\flask\cli.py", line 240, in locate_app
import(module_name)
File "C:\Users\panxi\Desktop\peach-blog\wsgi.py", line 3, in
application = create_app(os.environ.get('FLASK_ENV'))
File "C:\Users\panxi\Desktop\peach-blog\app_init
.py", line 33, in create_app
app.config.from_object(config[config_name])
KeyError: None

check comment before display

I found some junk information appeared in the posts these days,checking comments legally before displaying is essential

To everyone 🙋‍♀️🙋‍♂️

If this project has helped you, and you have successfully deployed your website with this project,
please leave your URL here and let more people see it.

Your reply will be the driving force for me to continue to update and maintain.

better seo

replace the url like '/post/int:id', '/tag/int:tag_id' to '/post/string:title' , '/tag/string:tag'

auto upgrade

can simplely upgrade peach-blog with only one click

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.