print and redirect after render

thumb
km0 2 years ago
parent 5c179497d5
commit 8b4d9a523a

@ -46,6 +46,7 @@ def get_md_contents(filename, directory='./contents'):
def render_home():
print('Rendering home...')
with open(app.root_path + 'render.html', 'w') as f:
# get the basic info of the website from the /contents/home.md file
meta, content = get_md_contents("home.md")
@ -70,6 +71,7 @@ def render_home():
"projects": projects_list
}
f.write(render_template("home.html", **home))
print('Rendered!')
# FLASK APP
@ -146,8 +148,9 @@ def pull():
@app.route('/api/render/')
def render():
print('Request for rendering')
render_home()
return 'rendered'
return redirect(url_for('home_page'))
# RUN
app.run(port="3132")

Loading…
Cancel
Save