赞
踩
from flask import Flask, abort, render_template import os from flask_sqlalchemy import SQLAlchemy import pymysql from app import app pymysql.install_as_MySQLdb() # 使用集成方式处理SQLAlchemy app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql://root:123456@localhost:3306/tibetmedicine?charset=utf8' app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False # 实例化db对象 db = SQLAlchemy(app) # 定义404界面 @app.errorhandler(404) def page_not_found(e): return render_template('error-404.html'
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。