32 lines
811 B
Python
32 lines
811 B
Python
"""
|
|
Project: PARTS Website
|
|
Author: Edward Middleton-Smith
|
|
Precision And Research Technology Systems Limited
|
|
|
|
Technology: App Routing
|
|
Feature: Blog - Home Routes
|
|
|
|
Description:
|
|
Home Page Controller.
|
|
"""
|
|
|
|
# internal
|
|
from business_objects.api import API
|
|
from models.model_view_blog_home import Model_View_Blog_Home
|
|
# external
|
|
from flask import render_template, jsonify, Blueprint, send_from_directory
|
|
|
|
|
|
routes_blog = Blueprint('routes_blog', __name__)
|
|
|
|
|
|
@routes_blog.route(Model_View_Blog_Home.HASH_PAGE_BLOG_HOME, methods=['GET'])
|
|
def blog_home():
|
|
try:
|
|
model = Model_View_Blog_Home()
|
|
html_body = render_template('layouts/layout_blog.html', model = model) # 'pages/blog/_home.html'
|
|
except Exception as e:
|
|
return jsonify(error=str(e)), 403
|
|
return html_body
|
|
|