To configure your site for Elastic Beanstalk - SethuGopalan/ebdjangoVR GitHub Wiki

Now that you have a Django-powered site on your local machine, you can configure it for deployment with Elastic Beanstalk.

By default, Elastic Beanstalk looks for a file named application.py to start your application. Because this doesn't exist in the Django project that you've created, you need to make some adjustments to your application's environment. You also must set environment variables so that your application's modules can be loaded.

  1. Activate your virtual environment.

    Unix: ~/ebdjango$ source ~/eb-virt/bin/activate

    Windows : C:\Users\USERNAME\ebdjango>%HOMEPATH%\eb-virt\Scripts\activate

  2. Run pip freeze, and then save the output to a file named requirements.txt.

    Unix : (eb-virt) ~/ebdjango$ pip freeze > requirements.txt

    windows : (eb-virt) C:> pip freeze > requirements.txt

    Elastic Beanstalk uses requirements.txt to determine which package to install on the EC2 instances that run your application

  3. Create a directory named .ebextensions

    Unix : (eb-virt) ~/ebdjango$ mkdir .ebextensions

    windows : (eb-virt) C:> md .ebextensions

  4. In the .ebextensions directory, add a configuration file named django.config with the following text.

    Example ~/ebdjango/.ebextensions/django.config

    add this script to the django.config

    option_settings:

    aws:elasticbeanstalk:container:python:

    WSGIPath: ebdjango.wsgi:application