Skip to content

Commit 78378d3

Browse files
authored
Merge pull request #404 from weakish/use-production
fix(LeanEngine): X-LC-Prod request header
2 parents ea73c70 + e6aec2d commit 78378d3

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

leancloud/client.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,16 @@
2525
APP_KEY = None
2626
MASTER_KEY = None
2727
HOOK_KEY = None
28-
USE_PRODUCTION = '1'
28+
if os.getenv('LEANCLOUD_APP_ENV') == 'production':
29+
USE_PRODUCTION = '1'
30+
elif os.getenv('LEANCLOUD_APP_ENV') == 'stage':
31+
USE_PRODUCTION = '0'
32+
else: # probably on local machine
33+
if os.getenv('LEAN_CLI_HAVE_STAGING') == 'true':
34+
USE_PRODUCTION = '0'
35+
else: # free trial instance only
36+
USE_PRODUCTION = '1'
37+
2938
USE_HTTPS = True
3039
# 兼容老版本,如果 USE_MASTER_KEY 为 None ,并且 MASTER_KEY 不为 None,则使用 MASTER_KEY
3140
# 否则依据 USE_MASTER_KEY 来决定是否使用 MASTER_KEY

0 commit comments

Comments
 (0)