from flask import Flask, render_template
from flask.ext.bootstrap import Bootstrap 

app = Flask(__name__)
bootstrap = Bootstrap(app)   #用Bootstrap模板玩玩

@app.errorhandler(404)
def page_not_found(e):
    return render_template('404.html'), 404

base.html

{% extends "bootstrap/base.html" %}
{% block title %}dllhook{% endblock %}
{% block navbar %}
<div class="navbar navbar-inverse" role="navigation">
         <div class="container">
             <div class="navbar-header">
                 <button type="button" class="navbar-toggle"
                  data-toggle="collapse" data-target=".navbar-collapse">
                     <span class="sr-only">Toggle navigation</span>
                     <span class="icon-bar"></span>
                     <span class="icon-bar"></span>
                     <span class="icon-bar"></span>
                </button>
                 <a class="navbar-brand" href="/">PiaoYun</a>
             </div>
             <div class="navbar-collapse collapse">
                 <ul class="nav navbar-nav">
                     <li><a href="/">Home</a></li>
                 </ul>
             </div>
         </div>
</div>
{% endblock %}
{% block content %} <div class="container">
{% block page_content %}{% endblock %} </div>
{% endblock %}

404.html:

{% extends "base.html" %}
{% block title %}dllhook - Page Not Found{% endblock %}
{% block page_content %} 
<div class="page-header">
    <h1>页面不存在哦~~~ 赶快到www.dllhook.com玩玩吧 吼吼~</h1>
</div>
{% endblock %}



你可能感兴趣的文章

评论区

发表评论

必填

选填

选填

必填

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。