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 ).
- Print 'content-type: text/plain'
- Print''
- 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:
- Application: helloworld
- Version: 1
- Runtime: Python
- Api_version: 1
- Handlers:
- -URL :/.*
- 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.