Deploying a Django application to AWS Elastic Beanstalk with HTTPS

Prerequisites

Before trying to deploy a Django application to AWS Elastic Beanstalk, make sure that you have a working knowledge of the following:

Finally, one article that may be helpful to review is Building RESTful APIs using Django Rest Framework

Steps

1. Create a Django application

2. Login to AWS and create a Elastic Beanstalk application

3. Deploy our Django application onto the Elastic Beanstalk environment

Your application should now successfully have been deployed to AWS Elastic Beanstalk. You can now make changes to your Django application and redeploy it to AWS Elastic Beanstalk by following the steps above.

4. Adding HTTPS to our Elastic Beanstalk environment (optional)

By following these steps we should now have HTTPS enabled on our Elastic Beanstalk environment.

Common Errors

  1. If you get an error that says “Your WSGIPath refers to a file that does not exist.” then you need to make sure that your WSGIPath in your .ebextensions folder matches the name of your project.
    • For example, if your project name is “test-app” then your WSGIPath should be “test-app.wsgi:application”
  2. If AWS did not automatically install the dependencies from the requirements.txt you may need to SSH into the instance and install them yourself using pip
    • You can follow this link for more information on how to SSH into your instance SSH into EB Instance

Refrences