Ex no:3 3.Install Google App Engine.
Create hello world app
Date: and other simple web applications using python/java.
Install Google App Engine (GAE)
First, GAE is part of Google Cloud. So installing GAE basically means setting
up Google Cloud SDK.
Install Google Cloud SDK:
Download: https://cloud.google.com/sdk/docs/install
After installing:
gcloud init
This will:
Authenticate your account
Set project and region
Now you have GAE tools ready.
Procedure for creating hello world app:
1.Create a new folder:
mkdir hello-python
cd hello-python
2.Create 3 files:
main.py
requirements.txt
app.yaml
I. main.py
python
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return 'Hello, World from Python GAE!'
if __name__ == '__main__':
app.run(host='127.0.0.1', port=8080, debug=True)
II. requirements.txt
Flask
III. app.yaml
yaml
runtime: python39
entrypoint: gunicorn -b :$PORT main:app
3.Install dependencies:
pip install -r requirements.txt
4.Deploy to App Engine:
gcloud app create
gcloud app deploy
5.After deployment:
gcloud app browse
Result:
Thus the installation of google app engine and the creation of hello world
app using python/java has been successfully executed and output was verified.