App Engine으로 Flask 웹 띄우기 (Git 사용)
https://www.cloudskillsboost.google/focuses/1014?hl=ko&parent=catalog
App Engine: Qwik Start - Python | Google Cloud Skills Boost
This hands-on lab shows you how to create a small App Engine application that displays a short message. Watch the short video <A HREF="https://youtu.be/s0-pfuXj1aA">Build Apps at Scale with Google App Engine</A>.
www.cloudskillsboost.google
Authentication문제 : 내 git repository가 private이었음.
public 으로 바꾸니 문제 해결.
>> 근데.. 바꾸자마자 구글에서 메일이 날아온다.
service key 가 노출되었다는 알림.
이렇게 되면 해킹을 통해서 과금이 어마어마하게 일어날 수 있다.
service key 노출하면 안된다는건 알고 있어서 소스코드에서도 빼놨다가 잠시 테스트를 위해 열었던건데 이렇게 바로 메일이 오다니.. 역시 보안에 더 신경써야한다 ㅠㅠ
Settings > General 가장 하단에 있다.
Change visibility를 Change to public (다 예 를 눌러주면됨)으로 바꿨다.
깃에 올린 파일 저장완료
cd 내파일경로
내 메인모듈이 있는 곳으로 이동한다.
내 프로젝트에는 app.yaml이 없는디..
급하게 추가해준다. 아래 링크에서 app.yaml 복사
https://cloud.google.com/appengine/docs/legacy/standard/python/config/appref
App Engine app.yaml 참조 | Python 2용 App Engine 표준 환경 | Google Cloud
주의: 앞으로 몇 개월에 걸쳐 Google은 콘텐츠를 보다 손쉽게 찾고 나머지 Google Cloud 제품과 더 잘 연동되도록 App Engine 문서 사이트를 재구성할 예정입니다. 제공되는 콘텐츠는 동일하지만, 이제
cloud.google.com
vi app.yaml
dev_appserver.py란?
Google Cloud CLI에는 로컬 개발 서버(dev_appserver.py)가 포함됩니다. 로컬 개발 서버를 사용하여 프로덕션 App Engine에서 애플리케이션 실행을 시뮬레이션하고 이를 사용해서 App Engine 번들 서비스에 액세스할 수도 있습니다.
라고 한다.
app.yaml도 작성해줘야한다.
dev_appserver.py app.yaml
를하니 뭔가 호스팅 하는 모양새가 나온다.
자세한건
https://cloud.google.com/appengine/docs/standard/python/tools/using-local-server?hl=ko
로컬 개발 서버 사용 | Python 2용 App Engine 표준 환경 | Google Cloud
주의: 앞으로 몇 개월에 걸쳐 Google은 콘텐츠를 보다 손쉽게 찾고 나머지 Google Cloud 제품과 더 잘 연동되도록 App Engine 문서 사이트를 재구성할 예정입니다. 제공되는 콘텐츠는 동일하지만, 이제
cloud.google.com
위 명령어를 치니 에러가 났다.
export APPLICATION_ID=dev~None
이걸 해준뒤 다시 dev_appserver.py app.yaml을 해줬다.
그랬더니 에러가 바뀌었다.
home 모듈은 어디서 나온거죠?
내가 임의로 넣어줬던 app.yaml에서 나온거다.
app.yaml을 내 프로젝트에 맞게 수정해보자. (얘로 수정함)
참고 :
https://cloud.google.com/appengine/docs/flexible/python/configuring-your-app-with-app-yaml?hl=ko
app.yaml로 앱 구성 | Google App Engine 가변형 환경 문서 | Google Cloud
App Engine 앱은 CPU, 메모리, 네트워크 및 디스크 리소스, 확장, 환경 변수를 비롯한 기타 일반 설정이 포함된 app.yaml 파일을 사용하여 구성됩니다. app.yaml 파일 정보 버전과 URL이 포함된 Python 앱의
cloud.google.com
새로운 에러가 떴다.
근데 이제 app.yaml 문제는 해결한것 같다.
Google AppEngine error: "No module named flask"
I'm following the directions provided by WebPutty's github page to put my own fork of WebPutty up on GAE. It runs fine locally. I wasn't able to run "fab deploy" successfully (got error "no module ...
stackoverflow.com
Can't import Flask while using Google App Engine
I'm following this guide and trying to develop a Flask app to run on the Google App Engine. I followed the guide to the letter but when I launch the dev app server from the Launcher and go to http://
stackoverflow.com