As11 Google App Engine
As11 Google App Engine
Before begin
1. Create a Google Cloud Platform project, if you don't have one already.
python -V
Note: As of Cloud SDK version 206.0.0, the gcloud CLI has experimental support for
running using a Python 3.4+ interpreter (run gcloud topic startup for exclusions and more
information on configuring your Python interpreter). All other Cloud SDK tools still require
a Python 2.7 interpreter.
3. Download the archive file best suited to your operating system. Most machines will run
the 64-bit package. If you'd like to check, run uname -m to verify if you're running a 64-bit
system.
Linux
google-cloud-sdk-
64-bit 25.6
229.0.0-linux- b1c87fc9451598a76cf66978dd8aa06482bfced639b56cf31559dc2c7f8b7b90
MB
(x86_64) x86_64.tar.gz
Linux
google-cloud-sdk-
32-bit 25.2
229.0.0-linux- ee8c45f8018d0fee92b07c32cc6d8c891241da0b88bfe289d4e58e6746c3f668
MB
(x86) x86.tar.gz
Alternatively, to download the Linux 64-bit archive file from your command-line, run:
curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-
229.0.0-linux-x86_64.tar.gz
curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-
229.0.0-linux-x86.tar.gz
4. Extract the archive to any location on your file system; preferably, your Home folder. On
Linux, you can extract the archive file by running this command:
5. If you're having trouble getting the gcloud command to work, ensure your $PATH is defined
appropriately. Use the install script to add Cloud SDK tools to your path. You will also be
able to opt-in to command-completion for your bash shell and usage statistics collection
during the installation process. Run the script using this command:
./google-cloud-sdk/install.sh
Alternatively, you can call Cloud SDK after extracting the downloaded archive by invoking
its executables via the full path.
Use the gcloud init command to perform several common SDK setup tasks. These include
authorizing the SDK tools to access Google Cloud Platform using your user account credentials and
setting up the default SDK configuration.
gcloud init
Note: To prevent the command from launching a web browser, use gcloud init --console-
only instead. To authorize without a web browser and non-interactively, create a service
account with the appropriate scopes using the Google Cloud Platform Console and use
gcloud auth activate-service-account with the corresponding JSON key file.
To continue, you must log in. Would you like to log in (Y/n)? Y
3. In your browser, log in to your Google user account when prompted and click Allow to grant
permission to access Google Cloud Platform resources.
4. At the command prompt, select a Cloud Platform project from the list of those where you
have Owner, Editor or Viewer permissions:
Pick cloud project to use:
[1] [my-project-1]
[2] [my-project-2]
...
Please enter your numeric choice:
If you only have one project, gcloud init selects it for you.
5. If you have the Google Compute Engine API enabled, gcloud init allows you to choose a
default Compute Engine zone:
gcloud init confirms that you have complete the setup steps successfully:
Run these gcloud commands to view information about your SDK installation:
Credentialed Accounts
ACTIVE ACCOUNT
* example-user-1@gmail.com
example-user-2@gmail.com
[core]
account = example-user-1@gmail.com
disable_usage_reporting = False
project = example-project
3. To view information about your Cloud SDK installation and the active SDK configuration:
gcloud info
gcloud displays a summary of information about your Cloud SDK installation. This includes
information about your system, the installed SDK components, the active user account and
current project, and the properties in the active SDK configuration.
4. To view information about gcloud commands and other topics from the command line:
gcloud help
For example, to view the help for gcloud compute instances create:
gcloud displays a help topic that contains a description of the command, a list of command
flags and arguments, and examples of how to use it.
Now as we have finished installing app engine, now it’s time to create
and upload an app. In this case we will be taking example of a
“HELLO WORLD” app in python.
1. As we already have made sure that we have python installed in our system, It will be easier for us
to clone existing code and deploy it rather than creating our own so we will use python docs-
sample. Run the command “git clone https://github.com/GoogleCloudPlatform/python-docs-
samples”.
2. cd python docs- samples/appengine/standard/hello_world
3. dev_appserver.py app.yaml