Skip to content

Commit 5d7a424

Browse files
committed
"global" CTK is now abble to work in virtualenv
1 parent e75f53b commit 5d7a424

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

CTK-run.pre

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ def write_cherokee_conf (app_file, CTK_root, SCGI_port):
1515
else:
1616
app_file_path = os.path.join (os.getcwd(), app_file)
1717

18+
# Get python executable, to make CTK work in virtualenv for example
19+
python_executable = sys.executable
1820
# Write the custom configuration file
1921
config = CONFIG_BASE[:]
2022
config = config.replace ('vserver!10!document_root = /var/www',
2123
'vserver!10!document_root = %s' %(CTK_root))
2224
config = config.replace ('source!1!interpreter = /usr/bin/true',
23-
'source!1!interpreter = python %s' %(app_file_path))
25+
'source!1!interpreter = %s %s' %(python_executable, app_file_path))
2426
config = config.replace ('source!1!host = localhost:8000',
2527
'source!1!host = localhost:%s' %(SCGI_port))
2628
config = config.replace ('vserver!10!rule!200!document_root = /var/www/static',

0 commit comments

Comments
 (0)