0 Star 0 Fork 1

easyhutu/Blog

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
run.py 1.36 KB
一键复制 编辑 原始数据 按行查看 历史
easyhutu 提交于 2016-12-13 20:38 . 加一些注释
from flask import Flask, render_template, redirect, url_for, request, jsonify
from flask_sqlalchemy import SQLAlchemy
from datetime import datetime
import os
app = Flask(__name__, static_url_path='')
app.debug = True
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///./db/myblog.db'
app.config['SQLALCHEMY_ECHO'] = False
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True
app.secret_key = 'saf678sf97as6fsaf670*^&(*$%('
db = SQLAlchemy(app)
from myblog import blog
# 注册blog蓝图
app.register_blueprint(blog, url_prefix='/blog')
from mylink import my_info
# 注册个人信息蓝图
app.register_blueprint(my_info, url_prefix='/myinfo')
from blogmanage import manage
# 注册控制模块蓝图
app.register_blueprint(manage, url_prefix='/manage')
from reguser import admin
# 注册账号管理蓝图
app.register_blueprint(admin, url_prefix='/user')
from ueditormanage import ueditor
# 注册ueditor编辑器后台蓝图
app.register_blueprint(ueditor)
@app.route('/')
def hello_world():
return redirect(url_for('blog.blog_index'))
@app.route('/404/')
def error():
return render_template('404.html')
@app.route('/about/')
def about():
return render_template('about.html')
@app.route('/waring/')
def waring():
return render_template('waring.html')
if __name__ == '__main__':
app.run()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/hehahutu/myblog.git
git@gitee.com:hehahutu/myblog.git
hehahutu
myblog
Blog
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385