title: Django app deployed on elastic beanstalk with MySQL RDS - tables never get created
body: <p>I have followed every guide, and tutorial, on setting up RDS MySQL for my Django app. Everything works fine locally. When I deploy, I get no errors. My website runs. But when I try to access the restful framework I have setup, or I try to log into the admin page, I get a ProgrammingError that the table doesn't exist (none of the tables exist).</p>
  
  <p>Access to the database doesn't seem to be the problem, all of my RDS environment variables are set up, the security group is set up, etc. I can even access the database from my local mysql client and I can see that the database has no tables in it. </p>
  
  <p>I have commands set up in my config file to run 'django-admin.py makemigrations' and 'django-admin.py migrate', I even tried changing this to 'python manage.py ...' etc., it seems like the commands never work.</p>
  
  <p>When I ssh into my elastic beanstalk environment, I can get into the mysql using 'mysql -u my_username'. However, if I navigate to the folder where my app is, and try to run 'python manage.py makemigrations' manually, I get this: django.db.utils.OperationalError: (1045, "Access denied for user 'my_username'@'localhost' (using password: YES)")</p>
  
  <p>Here is my config...</p>
  
  <p>requirements.txt</p>
  
  <pre><code>virtualenv==15.0.1
  Django==1.9.5
  django-compressor==2.0
  django-model-utils==2.4
  djangorestframework==3.3.2
  dj-database-url==0.4.0
  gunicorn==19.4.5
  MySQL-python==1.2.5
  jsonfield==1.0.3
  </code></pre>
  
  <p>.ebextentions/01_packages.config</p>
  
  <pre><code>packages:
    yum:
      git: []
      gcc: []
      mysql: []
      mysql-devel: []
      python-devel: []
  </code></pre>
  
  <p>.ebextentions/project.config</p>
  
  <pre><code>container_commands:
    01_makemigrations:
      command: "source /opt/python/run/venv/bin/activate &amp;&amp; python manage.py makemigrations --noinput"
      leader_only: true
    02_migrate:
      command: "source /opt/python/run/venv/bin/activate &amp;&amp; python manage.py migrate --noinput"
      leader_only: true
    03_createsu:
      command: "source /opt/python/run/venv/bin/activate &amp;&amp; python manage.py createsu"
      leader_only: true
    04_collectstatic:
      command: "source /opt/python/run/venv/bin/activate &amp;&amp; python manage.py collectstatic --noinput"
  </code></pre>
  
  <p>settings.py</p>
  
  <pre><code>DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.mysql',
          'NAME': os.environ['RDS_DB_NAME'],
          'USER': os.environ['RDS_USERNAME'],
          'PASSWORD': os.environ['RDS_PASSWORD'],
          'HOST': os.environ['RDS_HOSTNAME'],
          'PORT': os.environ['RDS_PORT'],
      }
  }
  </code></pre>
  
  <p>Please help. Thank you!</p>