Code for user instances on EC2, run in virtualenv.
Connect to the database instance by setting value of 'host' in config.py. Set it as the public IP of database instance if the database instance allows accessing from anywhere; set it as the private IP of database instance if the database instance only allows accessing from user instance's security group.