2

I'm new to django and aws and I'm trying to get my project deployed.

I have a similar filestructure as in the project here:

https://github.com/divanov11/crash-course-CRM/tree/Part-8---data-to-templates-and-template-tags/crm1_v7_database_queries

Now when I'm initializing zappa and they ask "What's the modular path to your app's function?" I have no idea which path I should put. Could anyone help me with this?

  • If you used this example you provided the answer would be crm1.settings, when you do Zappa init, it should discover that it is a Django application and your settings.py file. Here is a really good walk-through of deploying Django through Zappa: https://romandc.com/zappa-django-guide/walk_core/ I will also tell you while deploying that Zappa and API Gateway doesn't play well with Django > 2.1 – Chuck LaPress Apr 18 '20 at 15:50

1 Answers1

1

From Zappa official repo :

Running the Initial Setup / Settings Zappa can automatically set up your deployment settings for you with the init command:

$ zappa init

This will automatically detect your application type (Flask/Django - Pyramid users see here) and help you define your deployment configuration settings. Once you finish initialization, you'll have a file named zappa_settings.json in your project directory defining your basic deployment settings. It will probably look something like this for most WSGI apps:

{
    // The name of your stage
    "dev": {
        // The name of your S3 bucket
        "s3_bucket": "lambda",

        // The modular python path to your WSGI application function.
        // In Flask and Bottle, this is your 'app' object.
        // Flask (your_module.py):
        // app = Flask()
        // Bottle (your_module.py):
        // app = bottle.default_app()
        "app_function": "your_module.app"
    }
}

or for Django:

{
    "dev": { // The name of your stage
       "s3_bucket": "lambda", // The name of your S3 bucket
       "django_settings": "your_project.settings" // The python path to your Django settings.
    }
}

Be sure to run zappa init at the root folder of your project with a virtual environnement activated.

bloomverga
  • 11
  • 1