Set the Python path in Google App Engine launcher.
STEP 2:
IT uses the following structure for the project:
project_name/
├── [Link]
├── www/
├── [Link]
├── css/[Link]
├── js/[Link]
├── img/
├── other dir
[Link]: Configure the settings of your App Engine application.
www/: Directory to store all of your static files, such as HTML, CSS, images,
and JavaScript.
css/: Directory to store stylesheets.
[Link]: Basic stylesheet that formats the look and feel of your site.
img/: Optional directory to store images.
[Link]: An HTML file that displays content for your website.
js/: Optional directory to store JavaScript files.
Other asset directories.
[Link]
This file is a basic markup file that stores information (some metadata) about the
app. It is important to note the following crucial parts of the file.
application
This is the project ID which you should never change. This is the unique
identifier for the app
url -> script
This is the homepage for the app. In other words, this file will be rendered in
your browser when you launch the app
libraries
This is where you can include external libraries to use within the webapp
Update [Link] file.
runtime:
python27
api_version: 1
threadsafe: true
handlers:
- url: /
static_files:
www/[Link] upload:
www/[Link]
- url: /(.*) static_files:
www/\1 upload:
www/(.*)
Make Simple HTML file ([Link]) inside www directory to
deploy.
<html>
<head>
<title>Hello, world!</title>
<link rel="stylesheet" type="text/css"
href="/css/[Link]">
</head>
<body>
<h1>Hello, world!</h1>
<p>
This is a simple static HTML file that will be served from
Google App
Engine.
</p>
</body>
</html>
[Link]
This is the homepage of the app .
[Link] file in the webapp folder
STEP3:
App Engine sign-up
Here are the steps you need to follow to sign-up:
Go to the Google Cloud landing page
Follow the sign-up process and go to your App Engine dashboard
STEP 4:
The next step is to create a new Python project that you can work on.\
Hit the create button and Google should take a few minutes to set up all that is
necessary for your newly created app.
Go to Google App Engine launcher and create a new application.
Enter the project ID of your newly created app. Also, provide the folder (local
destination) where you wish to store the app locally.
Make sure you select the Python 2.7 as your runtime engine.
Hit the create button, and you should see your app listed on the window that
follows.
Hit the create button and Google should take a few minutes to set up all that is
necessary for your newly created app.
Wait for a few seconds until you can hit the Browse button. Once the Browse
button becomes clickable, click it.
This should take you to the browser, and you should see the hello world text
appear in your browser window.
Alternatively, you can manually go to the browser and use the port specified to
access the app.
IF USE CLI
Open Google Cloud SDK and go to the project directory.
Use command gcloud init to select and initialize the project
Type gcloud app deploy to deploy your web app on Google Cloud App Engine.
And then type gcloud app browse to browse your web app on Google Cloud
App Engine.