Feat(UI): Blog Home page as standalone view file.
This commit is contained in:
31
controllers/blog/blog.py
Normal file
31
controllers/blog/blog.py
Normal file
@@ -0,0 +1,31 @@
|
||||
"""
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user