Using South migrations with IBM Bluemix
Question: For a new app using Django 1.6, I am trying to create a `run.sh` that will run
the initial commands on Bluemix.

I found an answer
[here](https://developer.ibm.com/answers/questions/165725/unable-to-deploy-a-
python-django-application.html) that gives a run.sh file for the in-built
migration that is supported in Django 1.7+

    
    
    #!/bin/bash
    
     if [ -z "$VCAP_APP_PORT" ];
     then SERVER_PORT=80;
     else SERVER_PORT="$VCAP_APP_PORT";
     fi
    
     echo [$0] port is------------------- $SERVER_PORT
    
     python manage.py makemigrations
     python manage.py migrate
    
     echo "from django.contrib.auth.models import User; User.objects.create_superuser(username='username',password='password',email='you@example.com')" | python manage.py shell
    
     echo [$0] Starting Django Server...
     python manage.py runserver --noreload 0.0.0.0:$SERVER_PORT 
    

Is there an idempotent way to run the equivalent commands (`schemamigration
--auto`, `migrate`) in South?


Answer: I would strongly advice against creating your migrations on production. You
should create them in your local development environment, and test them before
you commit them along with the corresponding changes in your codebase.

The migrations are written in python files in a /migrations/ folder. You
should commit these files to your repository and push them to Bluemix (or
otherwise copy them). So manage.py schemamigration should only be run in
development and committed/pushed, and manage.py migrate can then safely be run
wherever you deploy your project.

