Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

外部文件怎么引用jumpserver的环境啊 #2782

Closed
vitaureatea opened this issue Jun 10, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@vitaureatea
Copy link

commented Jun 10, 2019

[简述你的问题]

使用版本

1.4.10

问题复现步骤

parent_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(file))))
APPS_DIR = os.path.join(parent_path, 'apps')
print(APPS_DIR)
sys.path.insert(0, APPS_DIR)
os.environ['DJANGO_SETTINGS_MODULE'] = 'jumpserver.settings'
import django
django.setup()

这样,在当前目录下执行 会提示无法找到celery库

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.