[TIL] Two Flask Toy Projects & AWS Deployment
03/03/2023
![[TIL] Two Flask Toy Projects & AWS Deployment](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1677717785310%2Fd9f53ba9-c2f2-4239-a2d5-5777a59bc178.png&w=3840&q=75)
Today, I learned how to use Flask to build a toy project for the back-end and deploy it on AWS. Through implementing two projects on my own, I gained a better understanding of the workflow and the communication between the back-end and front-end.
Toy Project 1: Bucket List Page

Webpage Workflow
Users can write their bucket lists and submit it
Submitted input will be saved in MongoDB
All items stored in MongoDB will be listed on the page
Users can mark each list as completed
Toy Project 2: NewJeans Fan Page

Webpage Workflow
Users can write their nickname and comment and submit it
Submitted input will be saved in MongoDB
All items stored in MongoDB will be listed on the page
OG Tag
<meta property="og:title" content="NewJeans Fan Book" /> <meta property="og:description" content="Support your artist!" /> <meta property="og:image" content="http://res.heraldm.com/content/image/2022/12/19/20221219000702_0.jpg" />Directory Info

AWS Deployment
How to deploy (by using AWS Elastic Beanstalk Environments)
Save your Access Key & Secret Access Key (under Secret Credential)
Follow all steps below
Prepare Terminal
mkdir deploycp app.py deploy/application.pycp -r templates deploy/templatespip freeze > deploy/requirements.txtcd deploy
Modify
deploy/application.py1) app = Flask(__name__) => application = app = Flask(__name__) 2) if __name__ == '__main__': app.run('0.0.0.0', port=5000, debug=True) => app.run()Install package:
pip install awsebcliSecurity Credentials:
eb initInitial Setting
eb create myweb
Click the URL created on the AWS website

How to modify after deployment
Make changes on files connected to localhost first to make sure it works properly on the local environment
Apply changes to files under
deployfolderMove to the
deployfolder throughcd deployEnter
eb deploy mywebfor updates

![[코테] 그리디 문제 - 무지의 먹방 라이브](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1712215455263%2F1ac1f35a-8862-4e42-8d0c-e2bea01e04c0.png&w=3840&q=75)
![[코테] Bfs 토마토](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1709032619170%2F70056896-c857-444b-9c99-45bfcb466806.png&w=3840&q=75)
![[코테] Dfs 문제 유형 - 그래프 내에서 구분하여 카운트 하기](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1709019361383%2Fb0585d72-c808-4169-83a9-2724f312e927.png&w=3840&q=75)
![[코테] DFS vs BFS](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708971211123%2F71f9386c-6a62-43b2-a602-4d084c24d6cf.png&w=3840&q=75)
![[코테] 여행경로](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708971251412%2F27ce72ed-8ee7-4d13-a02f-ff4bbe50c4be.png&w=3840&q=75)