changeset 401:4d4c4b73808e

Use absolute paths
author David Soria Parra <dsp@php.net>
date Sat, 08 Mar 2014 02:03:33 +0000
parents 20cfd68e9c49
children 4e908cffaa62
files hgwebsite.py hgwebsite.wsgi
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgwebsite.py	Fri Mar 07 16:08:01 2014 -0800
+++ b/hgwebsite.py	Sat Mar 08 02:03:33 2014 +0000
@@ -18,7 +18,8 @@
 def about(site=None):
     if not site:
         flask.abort(404)
-    tpath = os.path.join('templates', site, 'index.html')
+    root = os.path.dirname(os.path.abspath(__file__))
+    tpath = os.path.join(root, 'templates', site, 'index.html')
     if not os.path.exists(tpath):
         flask.abort(404)
     t = os.path.join(site, 'index.html')
--- a/hgwebsite.wsgi	Fri Mar 07 16:08:01 2014 -0800
+++ b/hgwebsite.wsgi	Sat Mar 08 02:03:33 2014 +0000
@@ -1,1 +1,3 @@
+import sys, os
+sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
 from hgwebsite import app as application