def posts_show(id):
    posts = Post.all()
    post = Post.find(id)
    return render_template('posts/show.html', post=post)
示例#2
0
文件: app.py 项目: faroukkhelil/Flask
def blog(id):
    post = Post.find(id)
    return render_template('blogs/blog.html', post=post)
def posts_index():
    posts = Post.all()
    return render_template('posts/index.html', posts=posts)
示例#4
0
文件: app.py 项目: faroukkhelil/Flask
def home():
    posts = Post.all()
    return render_template('pages/home.html', posts=posts)
示例#5
0
def show_posts(id):
    print(id)
    post = Post.find(id)
    post = posts[id - 1]
    return render_template("posts/show.html", post=post)
示例#6
0
from flask import Flask, render_template
from mocks import Post
app = Flask(__name__)

posts = Post.all()


@app.route('/')
def home():
    return render_template("home.html")


@app.route('/contact')
def contact():
    return render_template("contact.html")


@app.route('/about')
def about():
    return render_template("about.html")


@app.route('/blog')
def posts_index():
    posts = Post.all()
    return render_template("posts/index.html", posts=posts)


@app.route('/blog/post/<int:id>')
def show_posts(id):
    print(id)
示例#7
0
def post_show(id):
    post = Post.find(id)
    return render_template('post/show.html', post=post)
示例#8
0
def post_index():
    posts = Post.all()
    return render_template('post/index.html', toto=posts)