From e8dc03f121a97026143408d47c696341dadc3f43 Mon Sep 17 00:00:00 2001 From: Nicholas Staples Date: Tue, 19 Apr 2016 13:33:28 +0100 Subject: [PATCH] Doc file is loaded using current directory of the flask view. --- app/main/views/index.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/main/views/index.py b/app/main/views/index.py index 28959a9ef..d81bcdc23 100644 --- a/app/main/views/index.py +++ b/app/main/views/index.py @@ -1,4 +1,5 @@ import markdown +import os from flask import render_template, url_for, redirect, Markup from app.main import main from flask_login import login_required @@ -42,7 +43,8 @@ def terms(): @main.route('/documentation') def documentation(): - with open('docs/index.md') as source: + curr_dir = os.path.dirname(os.path.realpath(__file__)) + with open(os.path.join(curr_dir, '../../../docs/index.md')) as source: return render_template( 'views/documentation.html', body=Markup(markdown.markdown(