Hello, Google App Engine

Source: Internet
Author: User

Google App Engine does not know who has used it. I have heard of it before, but I have never tried it because I only use Java for development in Python, today, Google decided to start its Google App Engine journey.

I heard that Google only opened 10000 accounts around the world, and it was released in May. I didn't expect it to be successfully registered. Is it all open? No matter how much.

Google released an SDK that can simulate the Google App Engine environment on the local machine /. I downloaded all for Windows, and the installation was very simple. Google App Engine will automatically configure the environment variables for you. Think about how to configure the environment variables when learning Java, I think Google is more user-friendly.

After the installation, let's start our first Google App Engine Application ---- Hellow, world! First, create a new folder named helloworld. Then, click the following code in notepad and name it helloworld. py (note the suffix ).

  1. Print 'content-type: text/plain'
  2. Print''
  3. Print 'hello, world! '

The code first declares an HTTP header file used to describe the file content, and then outputs a blank line and information "Hello, world !". Create a configuration file for the Google App Engine Application named app. yaml. The content is as follows:

  1. Application: helloworld
  2. Version: 1
  3. Runtime: Python
  4. Api_version: 1
  5. Handlers:
  6. -URL :/.*
  7. Script: helloworld. py

The first line means that the app's flag is helloworld, which can be freely named, but must be unique. The next step is the version number and the runtime environment is Python. At the bottom, it means that a URL path will be processed by helloworld. py if it matches the expression. (Note: "/. *" matches all URLs)

Then, open the command prompt and enter the path to the folder where the dev_appserver.py helloworld. py file is located. Then, you can start and release your application helloworld. py, open your browser, and enter the address:Http: // localhost: 8080/The output result is displayed.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.