From d494ec9c8896ff55c41396567df94afd41a24d7e Mon Sep 17 00:00:00 2001 From: Chen Levy Date: Mon, 22 Feb 2016 14:13:02 +0200 Subject: [PATCH] fix invalid view for purly complied app When packing a compiled app, and distributing it without the non-compiled view views, run_view_in searches only the old style compiled view file: e.g. views_default_index.html.pyc and not in views.default.index.html.pyc, resulting in "invalid view (default/index.html)" 404 Exception. --- gluon/compileapp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gluon/compileapp.py b/gluon/compileapp.py index 68e993d9..84d47528 100644 --- a/gluon/compileapp.py +++ b/gluon/compileapp.py @@ -676,8 +676,8 @@ def run_view_in(environment): else: filename = pjoin(folder, 'views', view) if os.path.exists(path): # compiled views - x = view.replace('/', '_') - files = ['views_%s.pyc' % x] + x = view.replace('/', '.') + files = ['views.%s.pyc' % x] is_compiled = os.path.exists(pjoin(path, files[0])) # Don't use a generic view if the non-compiled view exists. if is_compiled or (not is_compiled and not os.path.exists(filename)):