Skip to content
This repository was archived by the owner on Jun 30, 2024. It is now read-only.

Commit a403c57

Browse files
committed
move python interpreter to settings
1 parent 24df6db commit a403c57

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

controllers/ajax.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -986,8 +986,11 @@ def preview_question():
986986
# Prevent any changes to the database when building a preview question.
987987
del env['DBURL']
988988
# Run a runestone build.
989+
# We would like to use sys.executable But when we run web2py
990+
# in uwsgi then sys.executable is uwsgi which doesn't work.
991+
# Why not just run runestone?
989992
popen_obj = subprocess.Popen(
990-
[sys.executable, '-m', 'runestone', 'build'],
993+
[settings.python_interpreter, '-m', 'runestone', 'build'],
991994
# The build must be run from the directory containing a ``conf.py`` and all the needed support files.
992995
cwd='applications/{}/build/preview'.format(request.application),
993996
# Capture the build output in case of an error.

models/0.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from gluon.storage import Storage
99
import logging
1010
from os import environ
11+
import sys
1112

1213
settings = Storage()
1314

@@ -61,3 +62,4 @@
6162
settings.logger = "web2py.app.runestone"
6263
settings.sched_logger = settings.logger # works for production where sending log to syslog but not for dev.
6364
settings.log_level = logging.DEBUG
65+
settings.python_interpreter = sys.executable

0 commit comments

Comments
 (0)