test rendering

thumb
km0 2 years ago
parent 50da1a5181
commit f8b2ee3cdc

@ -47,7 +47,7 @@ def get_md_contents(filename, directory='./contents'):
def render_home(): def render_home():
print('Rendering home...') print('Rendering home...')
with open(app.root_path + 'render.html', 'w') as f: with open('/home/kamo/public_html/render.html', 'w') as f:
# get the basic info of the website from the /contents/home.md file # get the basic info of the website from the /contents/home.md file
meta, content = get_md_contents("home.md") meta, content = get_md_contents("home.md")
projects_list = [] projects_list = []
@ -136,7 +136,7 @@ def pull():
if request.method == 'POST': if request.method == 'POST':
subprocess.call(['sh', '/home/kamo/public_html/update.sh']) subprocess.call(['sh', '/home/kamo/public_html/update.sh'])
with open(app.root_path + '/log.txt', 'a') as f: with open('/home/kamo/public_html/log.txt', 'a') as f:
f.write(request.form['payload']) f.write(request.form['payload'])
print(request.form['payload']) print(request.form['payload'])
@ -152,5 +152,7 @@ def render():
render_home() render_home()
return redirect(url_for('home_page')) return redirect(url_for('home_page'))
# RUN # RUN
app.run(port="3132") app.run(port="3132")

Loading…
Cancel
Save