A skeleton for building Python applications on Google App Engine with the
webapp2 framework.
See our other Google Cloud Platform github repos for sample applications and scaffolding for other python frameworks and use cases.
-
Install the App Engine Python SDK. See the README file for directions. You'll need python 2.7 and pip 1.4 or later installed too.
-
Clone this repo with
git clone https://github.com/GoogleCloudPlatform/appengine-try-python-webapp2.git
-
Install dependencies in the project's lib directory. Note: App Engine can only import libraries from inside your project directory.
cd appengine-try-python-webapp2 pip install -r requirements.txt -t lib
-
Run this project locally from the command line:
dev_appserver.py .
Visit the application http://localhost:8080
See the development server documentation for options when running dev_appserver.
To deploy the application:
-
Use the Cloud Developer Console to create a project/app id. (App id and project id are identical)
-
Use the Admin Console to view data, queues, and other AppEngine specific administration tasks.
-
appcfg.py -A <your-project-id> --oauth2 update .
OR Use the google gcloud CLI to deploy your app:
gcloud auth login # only necesssary once gcloud config set project <your-project-id> # only necessary once gcloud preview app deploy .
OR on supported platforms, use the GoogleAppEngineLauncher GUI tool to deploy your app.
-
Congratulations! Your application is now live at your-app-id.appspot.com
To add persistence to your models, use NDB for scale. Consider CloudSQL if you need a relational database.
See the Third party libraries page for libraries that are already included in the SDK. To include SDK libraries, add them in your app.yaml file. Other than libraries included in the SDK, only pure python libraries may be added to an App Engine project. If you would like more flexibility and customization over your project while still keeping the powerful automatic infrastructure management of AppEngine, consider [Managed VMs] (https://cloud.google.com/appengine/docs/managed-vms/).
Star this repo if you found it useful. Use the github issue tracker to give feedback on this repo.
See CONTRIBUTING.md
See LICENSE
Bill Prin, Takashi Matsuo, Jon Parrot