AWS elastic beanstalk is considered amongst those services which are particularly used for scaling up and deployment of web apps and services that are developed on different kinds of services such as but not limited to Java, Python, and Go and so on. If you are in a situation and wondering how to go about it, we are here to provide you with a step by step manual that can help you to deploy Django app on AWS elastic beanstalk. Let’s find out how.
But before we move on to the step by step guide, there are some requisites that should be followed:
Before starting off with the steps, make sure you have the below stated possessions ready;
1. Basic knowledge of Python with more focus inclined towards Django.
2. A basic AWS account to get started with.
3. AWS CLI downloaded and configured on the system.
4. EB CLI and Python downloaded in the system.
The required versions of Python could either be Python 3.6 or Pip 18.0 that can help you achieve your target.
1. Begin with designing a virtual environment so that Django can be downloaded along with its dependencies. This particular step helps in determining the packages that are needed for the application so that the necessary packages can be installed. When all this is done, just adjust and run the basic Django project.
2. The next step is to create the project in AWS Elastic Beanstalk. To do this, go to the console and enter all the necessary information that is asked to create program. In order to get Django project deployment done, a local virtual environment needs to be created and then a web server environment tier is to be selected.
3. Once the above step is done, a work environment is to be created and as soon as this is completed, you can follow the link which will enable that a simple application example has just been shaped.
However, if you are looking for a more detailed version, here is how to go about it;
1. A local work environment should be created which should create the below stated requirements.txt file as
This leads to creating an accurate dependencies after which settings need to be configured for beanstalk which can be obtained by making a new folder .ebextensions that should have a file inside named as Django.config that will help in rooting.
The above stated text will show where the wsgi file is located in the beanstalk.
As soon as you are done with the above steps, you can move on further with deployment. To do that, you need to run a command from the root directory eb init –p python2.7 django-app which helps in initializing the project towards beanstalk. You may also change the python as you want.
Once the environment is created, an extra information reflects on the display where you can access the deployed project by clicking on the eb open command through a link that is generated.
This is where you get to see the end result as a basic project which reflects how can one easily deploy Django app with AWS elastic beanstalk.
Last Updated on