def setup_db(self):

        with cd("/var/lib/postgresql"):
            with settings(warn_only=True):
                sudo("psql -c \"CREATE USER {0} WITH PASSWORD '{1}';\"".format(config.get("postgres_user", self.app_name), config.get("postgres_password", self.app_name)), user="postgres")
                sudo("createdb {0}".format(self.db_name), user="postgres")
                sudo("psql -c \"GRANT ALL PRIVILEGES ON DATABASE {0} TO {1};\"".format(self.db_name, config.get("postgres_user", self.app_name)), user="postgres")
Setup the postgres db
dataset/ETHPy150Open jmg/django_deployment/deployment/deploy.py/ServerDeployer.setup_db