2016-06-25 17:07:13 +02:00
|
|
|
"""
|
|
|
|
Use libraries from a virtualenv (by modifying sys.path) in production.
|
|
|
|
Also add Zulip's root directory to sys.path
|
|
|
|
"""
|
|
|
|
|
2017-09-22 18:30:18 +02:00
|
|
|
import os
|
2016-06-25 17:07:13 +02:00
|
|
|
import sys
|
|
|
|
|
2017-09-22 08:15:01 +02:00
|
|
|
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
2016-11-20 05:45:53 +01:00
|
|
|
activate_this = os.path.join(
|
|
|
|
BASE_DIR,
|
2017-08-24 04:21:50 +02:00
|
|
|
"zulip-py3-venv",
|
2016-11-20 05:45:53 +01:00
|
|
|
"bin",
|
|
|
|
"activate_this.py")
|
2016-06-25 17:07:13 +02:00
|
|
|
if os.path.exists(activate_this):
|
|
|
|
# this file will exist in production
|
2016-10-17 08:22:00 +02:00
|
|
|
exec(open(activate_this).read(), {}, dict(__file__=activate_this))
|
2016-06-25 17:07:13 +02:00
|
|
|
sys.path.append(BASE_DIR)
|