本文介绍了从 AWS EB Linux 实例运行 manage.py的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从 AWS EB (Elastic Beanstalk) Linux 实例运行 manage.py?

How to run manage.py from AWS EB (Elastic Beanstalk) Linux instance?

如果我从/opt/python/current/app"运行它,它会显示以下异常.

If I run it from '/opt/python/current/app', it shows the below exception.

Traceback (most recent call last):
  File "./manage.py", line 8, in <module>
    from django.core.management import execute_from_command_line
ImportError: No module named django.core.management

我认为这与 virtualenv 有关.有什么提示吗?

I think it's related with virtualenv. Any hints?

推荐答案

如何从 AWS Elastic Beanstalk AMI 运行 manage.py.

How to run manage.py from AWS Elastic Beanstalk AMI.

  • SSH 登录 Linux (eb ssh)
    • (可选可能需要运行 sudo su - 以获得适当的权限)
    • SSH login to Linux (eb ssh)
      • (optional may need to run sudo su - to have proper permissions)

      或者,您可以像下面这样运行命令:

      Or, you can run command as like the below:

      • cd/opt/python/current/app
      • /opt/python/run/venv/bin/python manage.py

      这篇关于从 AWS EB Linux 实例运行 manage.py的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-24 11:59