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











78 comments:

  1. Finding the time and actual effort to create a superb article like this is great thing. I’ll learn many new stuff right here! Good luck for the next post buddy..
    SEO Company in Chennai

    ReplyDelete
  2. This is an awesome post.Really very informative and creative contents. These concept is a good way to enhance the knowledge.I like it and help me to development very well.Thank you for this brief explanation and very nice information.Well, got a good knowledge.
    Isoft Innovations Facebook

    ReplyDelete
  3. It's interesting that many of the bloggers to helped clarify a few things for me as well as giving.Most of ideas can be nice content.The people to give them a good shake to get your point and across the command.

    Hadoop Training in Chennai

    ReplyDelete
  4. 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
  5. Really, these quotes are the holistic approach towards mindfulness. In fact, all of your posts are. Proudly saying I’m getting fruitfulness out of it what you write and share. Thank you so much to both of you.
    Office Interior Designers in Coimbatore
    Office Interior Designers in Bangalore
    Office Interior Designers in Hyderabad

    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..
    Tooth Braces In Chennai
    Best Dental Clinic In Vellore

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

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

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

    ReplyDelete
  10. 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
  11. Python will be very good technology study and hire in corporate industry.


    java Training in Chennai

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

    ReplyDelete
  13. i really like this blog.And i got more information's from this blog.thanks for sharing!!!!
    Digital Marketing Company in Chennai

    ReplyDelete
  14. 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..
    Psoriasis Treatment
    Pimple Treatment
    Psoriasis Shampoo

    ReplyDelete
  15. 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
  16. Great articles, first of all Thanks for writing such lovely Post! Earlier I thought that posts are the only most important thing on any blog. But here at

    Shout me loud I found how important other elements are for your blog.Keep update more posts..
    cloud computing training in chennai


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

    ReplyDelete
  18. 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
  19. This information is impressive; I am inspired with your post writing style & how continuously you describe this topic.
    Eczema Treatment

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

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

    ReplyDelete
  22. 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
  23. its really very useful topic. it should be help us more and then thanks to post article like this.
    Peridotsystems

    ReplyDelete
  24. I have read your blog and i got a very useful and knowledgeable information from your blog.You have done a great job .I feel happy to read your post.Thanks for sharing.

    Dataware Tools
    HADOOP Training in Chennai
    Base SAS Training in Chennai
    MSBI Training in Chennai
    INFORMATICA Training in Chennai
    DATAWAREHOUSE Training in Chennai

    ReplyDelete
  25. 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
  26. It’s the best time to make some plans for the future and it is time to be happy. I’ve read this post and if I could I want to suggest you few interesting things or suggestions.You can write next articles referring to this article. I desire to read even more things about it..
    Wooden Temple for Home
    Tanjore Painting
    Pooja Mandir

    ReplyDelete
  27. Thanks for sharing this valuable information.I have read your blog and i got a very useful and knowledgeable information from your blog.You have done a great job.

    SAP Training Institute in Chennai
    SAP ABAP Training in Chennai
    SAP FICO Training in Chennai
    SAP MM Training in Chennai
    SAP Training in Chennai


    ReplyDelete
  28. 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
  29. I must thank you for the efforts you have put in spending this site. I am hoping to 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..
    Java Training in Chennai
    Dot Net Training in Chennai
    Cloud Computing Training in Chennai
    Digital Marketing Training in Chennai
    SAS Training in Chennai
    SEO Training in Chennai
    AWS Training in Chennai
    Microsoft Azure Training in Chennai

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

    Selenium Training in Chennai

    ReplyDelete
  31. 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
  32. 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
  33. Good information. It was really useful. looking forward for more useful information
    digital marketing company in chennai

    ReplyDelete

  34. 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
  35. i have really enjoyed sharing your website. thank you so much for your sharing this document. this document more useful and improve our knowledge.
    salesforce training in chennai

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

    SAP ABAP Training in Chennai

    ReplyDelete
  37. The blog is very different and useful. The way of writing makes it more interesting.

    PYTHON Training in Chennai

    ReplyDelete
  38. Thanks for sharing useful information........Really it is an amazing article
    Best Training centre in chennai

    ReplyDelete
  39. Its really an Excellent post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog. Thanks for sharing
    SAP HR Training in Chennai
    SAP SD Training in Chennai

    ReplyDelete
  40. 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
  41. Nice to see your blog post.. I really enjoyed by reading your blog post.
    Informatica Training Institute in chennai



    ReplyDelete
  42. 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
  43. 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
  44. Very nice post here thanks for it I always like and search such topics and everything connected to them.Excellent and very cool idea and the subject at the top of magnificence and I am happy to comment on this topic through which we address the idea of positive.

    OFFERS IN CHENNAI

    ReplyDelete
  45. Thanks for the informative article. This is one of the best resources I have found in quite some time. Nicely written and great info. I really cannot thank you enough for sharing.

    Wellnesscentres in Chennai
    Weightloss in Chennai
    Weightgain in Chennai

    ReplyDelete
  46. I truly appreciate this post. I’ve been looking all over for this! Thank goodness I found it on Bing. You have made my day! Thanks again! Keep update more excellent posts..
    Economics Journal
    Journal Of Ecology
    Thesis by publication
    National Journal
    Journal Of Information Technology

    ReplyDelete
  47. All the latest updates from the PythonAutomationminds team. Python Automationminds lets you program in Python, in your browser. No need to install any software, just start coding straight away. There's a fully-functional web-based console and a programmer's text-editor
    Phyton training in Chennai

    ReplyDelete
  48. Learn about other Apache projects that are part of the Hadoop ecosystem, including Pig, Hive, HBase, ZooKeeper, Oozie, Sqoop, Flume, among others. Big Data University provides separate courses on these other projects, but we recommend you start here.

    Bigdata training in Chennai OMR

    ReplyDelete
  49. To maximize impact of RPA, identify impactful processes. These processes tend to be Impacting both cost and revenues , High volume , With low fault tolerance , Error prone , Speed-sensitive , Requiring irregular labor , Distributed processes that require coordinated efforts of multiple departments ,Select processes that can be easily automated with RPA. Such processes tend to be
    Rules based
    Company-specific
    Not on the roadmap for new systems
    Robotic Process Automation RPA training in chennai

    ReplyDelete
  50. Benefits of reading your post. This will help in the maintenance of our health.The daily routine will help you lose weight quickly and safely.My life is totally transformed after I followed this diet.I feeling great about myself.

    Herbalife in Chennai
    Nutritionclub in Chennai
    Weight Loss in Chennai
    Weight Gain in Chennai

    ReplyDelete
  51. It's interesting that many of the bloggers your tips helped to clarify a few things for me as well as giving.. very specific nice content. And tell people specific ways to live their lives.Sometimes you just have to yell at people and give them a good shake to get your point across.

    Indian Sweets Online USA

    Order Indian Sweets Online

    Best Indian Sweets

    Indian Sweets Near Me

    ReplyDelete
  52. Your site is amazing and your blogs are informative and knlowledgeble to my websites.This is one of the best tips in my life.I have in quite some time.Nicely written and great info.Thanks to share the more informations.

    Seo Experts
    Seo Company
    Web Designing Company
    Digital Marketing
    Web Development Company
    App Development

    ReplyDelete

  53. 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 Training in chennai

    ReplyDelete
  54. 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
  55. All the latest updates from the Python Automationminds team. Python Automationminds lets you program in Python, in your browser. No need to install any software, just start coding straight away. There's a fully-functional web-based console and a programmer's text-editor
    Phyton training in Chennai

    ReplyDelete
  56. Robotic Process Automation (RPA) is one of the most exciting developments in Business Process Management (BPM) in recent history. Some industry experts believe it may be even more transformational than cloud computing transformational than cloud Automationminds team. (RPA)Automationminds lets you program in (RPA),
    Robotic Process Automation course

    ReplyDelete
  57. excellent oracle dba training i got in AUTOMATIONMINDS..hi this is rADHA last month i have did oracle dba training in AUTOMATIONMINDS really there coaching was very good and there fees is very controlled manner i just refer many of my frds too ,if you want to do oracle dba or pl/sql just refer them they may give some guidances too thanks you. best oracle institute with real time working professionals. I love AUTOMATIONMINDS
    Oracle SQL/PLSQL course

    ReplyDelete
  58. 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
  59. All the latest updates from the Python Automationminds team. Python Automationminds lets you program in Python, in your browser. No need to install any software, just start coding straight away. There's a fully-functional web-based console and a programmer's text-editor
    Phyton training in Chennai

    ReplyDelete
  60. 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 Training in chennai

    ReplyDelete
  61. 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
  62. 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
  63. 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
  64. I like your blog, I read this blog please update more content on python, further check it once at python online training

    ReplyDelete
  65. Thank you for your information.it is very nice article.
    AWS Online Training

    ReplyDelete
  66. I like your blog, I read this blog please update more content on python, further check it once at python online training

    ReplyDelete