1. David Soria Parra
  2. hg-website

Commits

php  committed 4d4c4b7

Use absolute paths

  • Participants
  • Parent commits 20cfd68
  • Branches default

Comments (0)

Files changed (2)

File hgwebsite.py

View file
  • Ignore whitespace
 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')

File hgwebsite.wsgi

View file
  • Ignore whitespace
+import sys, os
+sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
 from hgwebsite import app as application