[Answer]-Trouble launching AWS environment with django

1πŸ‘

βœ…

I was having this exact problem all day yesterday and I am using ubuntu 13.10.
I also tried deleting the options file under .ebextensions to no avail.
What I believe finally fixed the issue was under
~/mysite/requirements.txt
I double checked what the values were after I was all set and done doing eb init and eb start and noticed they were different from what http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_Python_django.html mentioned at the beginning of the tutorial.
The file was missing the MySQL line when I checked during the WSGIPath problem, I simply added the line :

MySQL-python==1.2.3

and then committed all the changes and it worked.

If that doesn’t work for you, below are the .config file settings and the directory structure.

My .config file under ~/mysite/.ebextensions is exactly what was in the tutorial, minus the secret key and access key, you need to replace those with your own:

container_commands:
  01_syncdb:    
    command: "django-admin.py syncdb --noinput"
    leader_only: true

option_settings:
  - namespace: aws:elasticbeanstalk:container:python
    option_name: WSGIPath
    value: mysite/wsgi.py
  - option_name: DJANGO_SETTINGS_MODULE
    value: mysite.settings
  - option_name: AWS_SECRET_KEY
    value: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
  - option_name: AWS_ACCESS_KEY_ID
    value: AKIAIOSFODNN7EXAMPLE

My requirements.txt:

Django==1.4.1
MySQL-python==1.2.3
argparse==1.2.1
wsgiref==0.1.2

And my tree structure. This starts out in ~/ so if I were to do

  • cd ~/
  • tree -a mysite

You should get the following output, including a bunch of directories under .git ( I removed them because there is a lot):

mysite
β”œβ”€β”€ .ebextensions
β”‚   └── myapp.config
β”œβ”€β”€ .elasticbeanstalk
β”‚   β”œβ”€β”€ config
β”‚   └── optionsettings.mysite-env
β”œβ”€β”€ .git
β”œβ”€β”€ .gitignore
β”œβ”€β”€ manage.py
β”œβ”€β”€ mysite
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ __init__.pyc
β”‚   β”œβ”€β”€ settings.py
β”‚   β”œβ”€β”€ settings.pyc
β”‚   β”œβ”€β”€ urls.py
β”‚   β”œβ”€β”€ wsgi.py
β”‚   └── wsgi.pyc
└── requirements.txt

Leave a comment