[Django]-Error: Please define stage 'create_pg_db' in your Zappa settings

3👍

You only have one stage defined which is called production. If you want to name your stage create_pg_db then it would like this:

{
    "create_pg_db": {
        "aws_region": "us-east-1",
        "django_settings": "Cool.settings",
        "profile_name": "default",
        "project_name": "cool",
        "runtime": "python3.6",
        "s3_bucket": "cool-7dsfsdf5",
        "project_directory": "/tmp/code",
        "slim_handler": true,
        "vpc config": {
            "SubnetIds": [
                "subnet-3132ss13b",
                "subnet-321321319",
                "subnet-2c2313223",
                "subnet-5ljlkjljd",
                "subnet-132121357",
                "subnet-f925f9c7"
            ],
            "SecurityGroupIds": [
                "sg-a9asdasd"
            ]
        }
    },
    "production_ap_northeast_1": {
        "aws_region": "ap-northeast-1",
        "extends": "production"
    },
    "production_ap_northeast_2": {
        "aws_region": "ap-northeast-2",
        "extends": "production"
    },
    ... All regions...

    "production": {
        "aws_region": "us-east-1",
        "django_settings": "Cool.settings"
    ... MORE settings...    
}

At the end you can add more stages and then use the stage for your deployment. For example, you can have a develop stage that deploys your code to a development environment and a production stage that deploys your code to the production environment.

Leave a comment