Thursday, December 10, 2015

Deploying a Django App to AWS Elastic Beanstalk


                                 
                                    Deploying a Django App to AWS Elastic Beanstalk

Introduction


Amazon Web Services (AWS) comprises dozens of services, each of which exposes an area of functionality. While the variety of services offers flexibility for how you want to manage your AWS infrastructure, it can be challenging to figure out which services to use and how to provision them.
With Elastic Beanstalk, you can quickly deploy and manage applications in the AWS cloud without worrying about the infrastructure that runs those applications. AWS Elastic Beanstalk reduces management complexity without restricting choice or control. You simply upload your application, and Elastic Beanstalk automatically handles the details of capacity provisioning, load balancing, scaling, and application health monitoring. 

The following steps is tell you  how to setup and deploy a Django application toAmazon Web Services (AWS) all while remaining sane.

Technology/Tool used
  • Python
  • Django
  • Amazon Elastic Beanstalk,EC2,S3 and RDS
  • EB CLI . 3 . X
  • Postgresql/mysql
Note: Amazon Elastic Beanstalk does not support Python 3 natively

Step 1 :
  • Create main root directory 
  • Create  a virtualenv [ (1)pip install virtualenv,virtualenv envname ]
  • Install packages using pip commands [pip install django==1.8.5]
  • Create a package using command (django-admin.py startproject main_website
  • Create a apps inside the main_website project using[python manage.py startapp home]
  • Install the apps in settings.py
  • Set the database according your needs
  •  Create a requirements.txt file inside the root directory [ pip freeze > requirements.txt]
  • add file .gitignore in root directory
Step 2 :
  • Install awsebcli in your machine (using pip , pip install awsebcli)
  • Configure aws in your machine with key and access id [ aws configure command in your machine it will ask you to enter the credentials , add the credentials then  aws will created ]
  • Locate the project root directory [ using cd command cd eb_main_website ]
Step 3 :
  • Test eb Installation is working fine [ eb --version ]
Step 4 :
  • Configure EB - Initialize project with aws 
  • Enter eb init
  • Your need to enter the Credentials,Application name,Python version,SSH,RSA keypair
  • Once you enter the these data eb init will create a file in .elasticbeanstalk  in main directory , there you can see the file called config.yml
Project Structure

  -- eb_main_website [ Main Directory ]
   |
   |----.ebextensions
   |    |
   |   |---01-main_website.config
   |   |---02_python.config
   |
   |----.elasticbeanstalk
   | |
   | |---.config.yml
   | |---.iod-test.env.yml
   |
   |----main_website
   | |
   | |---apps
   | | |
   | | |---staffs
   | |---home
   | |   |---__init__.py
   | |   |
   | |   |---management
   | |   |
   | |   |---__init__.py
   | |   |
   | |   |---commands
   | |   |
   | |   |--- __init__.py
   | |   |
   | |   |--- createsu.py
   |    |
   |    |---main_website
   | |
   | |--- __init__.py
   | |
   | |--- settings.py
   | |
   | |--- urls.py
   | |
   | |--- wsgi.py
   |
   |----www
   | |
   | |--static
   |
   |---- .gitignore
   |
   |---- error.txt
   |
   |--- requirements.txt











52 comments:

  1. Excellent goods from you, man. I’ve understand your stuff previous to and you’re just too excellent. I actually like what you’ve acquired here, certainly like what you are stating and the way in which you say it. You make it enjoyable and you still take care of to keep it sensible. I can not wait to read far more from you. This is actually a tremendous site..
    Informatica Training in Chennai
    Selenium Training in Chennai

    ReplyDelete
  2. I must thank you for the efforts you have put in penning this site. I am hoping to check out the same high-grade content by you later on as well. In truth, your creative writing abilities has inspired me to get my own, personal blog now..
    Tooth Braces In Chennai
    Best Dental Clinic In Vellore

    ReplyDelete
  3. i will thank u so much this time to must.i will really inspired for this sharing information.Vmware Training in Chennai

    ReplyDelete
  4. I AM thank u so much.its y.thank ur wonderful oppurtunity.
    and your postVmware Training in Chenna

    ReplyDelete
  5. Thank you for your sharing information..Its very interesting and useful..
    SAP Training in Chennai

    ReplyDelete
  6. I must thank you for the efforts you have put in penning this site. I am hoping to check out the same high-grade content by you later on as well. In truth, your creative writing abilities has inspired me to get my own, personal blog now..
    AP ABAP Training in Chennai

    ReplyDelete
  7. Python will be very good technology study and hire in corporate industry.


    java Training in Chennai

    ReplyDelete
  8. This information is very useful for me and thank u so much
    cloud computing training in chennai

    ReplyDelete
  9. There are lots of information about latest technology and how to get trained in them, like this have spread around the web, but this is a unique one according to me. The strategy you have updated here will make me to get trained in future technologies. By the way you are running a great blog.
    Thanks for sharing this.
    MSBI Training in Chennai

    ReplyDelete
  10. i am visiting first time to your blog awesome post you have written, thank for sharing
    SEO Training in Chennai

    ReplyDelete
  11. Thank you for sharing the information about an amazon web services. This is will be so useful to work on the aws-:)

    SAP ABAP Training in Chennai


    SAP MM Training in Chennai


    SAP HR Training in Chennai

    ReplyDelete
  12. This information is impressive.I am inspired with your post writing style & how continuously you describe this topic.
    Peridotsystems

    ReplyDelete
  13. This comment has been removed by the author.

    ReplyDelete
  14. Amazon web services is a great platform to upload your applications, access the applications because it is due to cloud computing where huge volumes of data are stored. Django app using AWS is a great idea and it is more cost effective too. Could you explain more in detail about project structure?
    Psoriasis Treatment

    ReplyDelete
  15. its really very useful topic. it should be help us more and then thanks to post article like this.
    Peridotsystems

    ReplyDelete
  16. Step by step procedure is clearly given in this article which helps to understand the concepts easily and This article is really informative and useful as far as I concern and keep going.
    Psoriasis Treatment | Psoriasis Treatment | Psoriasis Shampoo
    Vitiligo Treatment | Pigmentation Cream

    ReplyDelete
  17. There are lots of information about latest technology and how to get trained in them, like this have spread around the web, but this is a unique one according to me. The strategy you have updated here will make me to get trained in future technologies. By the way you are running a great blog. Thanks for sharing this.
    peridotsystems
    Tableau Training in Chennai
    AWS Training in Chennai

    ReplyDelete
  18. A great content and very much useful to the visitors. looking for more updates in future.

    Selenium Training in Chennai

    ReplyDelete
  19. Great.Nice information.It is more useful and knowledgeable. Thanks for sharing keep going on.
    SEO company in India
    Digital Marketing Company in Chennai

    ReplyDelete
  20. very very amazing explaintion....many things gather about yourself...yes realy i enjoy it...It is very usefull...
    Hadoop training in chennai
    DigitL Mrketing course in chennai
    AWS training in chennai

    ReplyDelete
  21. Good information. It was really useful. looking forward for more useful information
    digital marketing company in chennai

    ReplyDelete

  22. It is really a great and useful piece of info. I’m glad that you shared this helpful info with us. Please keep us informed like this. Thank you for sharing.
    Web design company in chennai

    ReplyDelete
  23. Really i got more information from your knowledge....Thank you for sharing such a nice and interesting blog..

    SAP ABAP Training in Chennai

    ReplyDelete
  24. This comment has been removed by the author.

    ReplyDelete
  25. Very nice post here thanks for it I always like and search such topics and everything connected to them. Keep update more information..

    Best Dental Hospital in Chennai | Laser Root Canal Treatment In Chennai | Teeth Whitening treatment | Root Canal Treatment In Chennai

    ReplyDelete
  26. Nice to see your blog post.. I really enjoyed by reading your blog post.
    Informatica Training Institute in chennai



    ReplyDelete
  27. Thanks for sharing the valuable information here. So i think i got some useful information with this content. Thank you and please keep update like this informative details.

    Manufacturing ERP
    Human Resources Management Software
    CCTV Camera Dealers in Chennai

    ReplyDelete
  28. Very nice post here thanks for it I always like and search such topics and everything connected to them. Keep update more information..AWS Online Course

    ReplyDelete
  29. I think it's awesome someone is finally taking notice of our vet's and doing something to help them. I hope all goes well with these articles. More new information i will get after refer that post.
    Mobile App Development Company In Chennai
    Android App Development Company In Chennai
    Android Application Development Company In Chennai
    Custom Web Application Development Company In Chennai

    ReplyDelete
  30. As you have now understood the usage of ‘Record and Playback’ tool, the following are the different posts using which you can explore the functioning of ‘Selenium IDE’
    selenium chennai

    ReplyDelete
  31. http://ibdpartnership.blogspot.com/SQream Technologies provides you with a state of the art software which combines modern GPU technology (Graphic Processing Units) with the best practices in today’s Big Data platforms, providing up to 100x faster insights from data.
    Bigdata Training in Chennai OMR

    ReplyDelete
  32. Thank you for sharing such great information with us. I really appreciate everything that you’ve done here and am glad to know that you really care about the world that we live in
    angularjs-Training in tambaram

    angularjs-Training in sholinganallur

    angularjs-Training in velachery

    angularjs Training in bangalore

    angularjs Training in bangalore

    ReplyDelete
  33. A nice article here with some useful tips for those who are not used-to comment that frequently. Thanks for this helpful information I agree with all points you have given to us. I will follow all of them.
    Asset Management Software
    Asset Tracking Software
    Asset Management Software India
    Asset Management Software Chennai

    ReplyDelete
  34. Such an nice post thank you for sharing. The provifded informations are in full experienced based it will help us many way.
    Best Laser Dental Clinic
    Full mouth dental implants in Chennai
    Best Dentist In Chennai
    Best Dental Clinic in Chennai
    Best dental clinic in nungambakkam

    ReplyDelete
  35. Thanks for sharing the informative blog posting

    Piping Design Engineering course is a job oriented diploma course. Sanjary academy provide best piping design course in Hyderabad, India with job assistance.
    Piping Design Course
    Piping Design Course in India­
    Piping Design Course in Hyderabad

    ReplyDelete
  36. Dr. Prabhu Dental Studio is providing the best dental service. All types of dental issues solved here.
    This is a very useful post and relevant post. It is full of information and clears all the doubt. Thanks for this post. Keep blogging. Dental Clinic In Velachery
    Dental Surgeon in Velachery
    Dentist In Velachery
    Dental Hospital In Velachery
    Best dentist in velachery
    Best Dental Clinic In Velachery
    Dental hospital in Velachery
    Pediatric Dentist In Velachery Chennai
    Dental Hospital In Velachery Chennai
    Dental care in velachery

    ReplyDelete
  37. Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.

    Python

    Data Science

    Selenium

    ETL Testing

    AWS

    ReplyDelete
  38. This information is really awesome thanks for sharing most valuable information.
    Python

    ReplyDelete
  39. There are lots of information about latest technology and how to get trained in them, like this have spread around the web. We are technology/news/smartphone company, If you want to read such useful news then, Visit us: https://techmie.com/

    ReplyDelete

  40. Great post i must say and thanks for the information.

    Data Scientist Course in pune

    ReplyDelete
  41. Here at this site really the fastidious material collection so that everybody can enjoy a lot. ExcelR Data Science Courses

    ReplyDelete
  42. This comment has been removed by the author.

    ReplyDelete