Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run manage.py from AWS EB Linux instance

Tags:

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

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 

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

like image 841
Wonil Avatar asked Nov 15 '13 09:11

Wonil


1 Answers

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

  • SSH login to Linux (eb ssh)
    • (optional may need to run sudo su - to have proper permissions)
  • source /opt/python/run/venv/bin/activate
  • source /opt/python/current/env
  • cd /opt/python/current/app
  • python manage.py <commands>

Or, you can run command as like the below:

  • cd /opt/python/current/app
  • /opt/python/run/venv/bin/python manage.py <command>
like image 160
Wonil Avatar answered Oct 14 '22 04:10

Wonil