예제 #1
0
def index():

    Religion = Blog.query.filter_by(category="Religion").all()
    Politics = Blog.query.filter_by(category="Politics").all()
    Love = Blog.query.filter_by(category="Love").all()
    Cancer = Blog.query.filter_by(category="Cancer").all()
    Science = Blog.query.filter_by(category="Science").all()
    quotes = get_quote()
    blogs = Blog.query.filter().all()
    return render_template('index.html',
                           Religion=Religion,
                           Politics=Politics,
                           Love=Love,
                           Cancer=Cancer,
                           Science=Science,
                           blog=blog,
                           quotes=quotes)
예제 #2
0
파일: views.py 프로젝트: allanLAS/Blog
def quote():
    quote = requests.get_quote()
    return render_template('quote.html', quote=quote)
예제 #3
0
파일: views.py 프로젝트: allanLAS/Blog
def about():
    quote = requests.get_quote()
    return render_template('quote.html', title='About', quote=quote)
예제 #4
0
def home():
    quote = requests.get_quote()
    posts = Post.query.all()
    return render_template('home.html', posts=posts, quote=quote)
예제 #5
0
def home():
    title= 'Home - Pitch APP '
    quote = requests.get_quote()
    return render_template('index.html',title=title, quote=quote)
예제 #6
0
def index():
    blogs = Blog.query.all()
    quote = get_quote()
    title = "welcome"
    return render_template("index.html", title=title, blogs=blogs, quote=quote)
예제 #7
0
파일: routes.py 프로젝트: Brian-M-code/blog
def home():
    page = request.args.get('page', 1, type=int)
    posts = Post.query.order_by(Post.date_posted.desc()).paginate(page=page,
                                                                  per_page=5)
    quote = requests.get_quote()
    return render_template('home.html', posts=posts, quote=quote)