Skip to content

Commit

Permalink
Update template for appengine python.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffmendoza committed Mar 26, 2015
1 parent 035cd2a commit 4f0504c
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 32 deletions.
67 changes: 35 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,56 @@
## Project name
## Project Name

A description of what this project does and who it serves.
Project description.

Include authorship, support contact and release information.
See our other [Google Cloud Platform github
repos](https://github.com/GoogleCloudPlatform) for sample applications and
scaffolding for other python frameworks and use cases.

## Run Locally
1. Install the [Google Cloud SDK](https://cloud.google.com/sdk/), including the [gcloud tool](https://cloud.google.com/sdk/gcloud/), and [gcloud app component](https://cloud.google.com/sdk/gcloud-app).
2. Setup the gcloud tool.

## Project setup, installation, and configuration
```
gcloud components update app
gcloud auth login
gcloud config set project <your-app-id>
```
You don't need a valid app-id to run locally, but will need a valid id to deploy below.

1. Clone this repo.

How do I, as a developer, start working on the project?
```
git clone https://github.com/GoogleCloudPlatform/<REPO NAME>.git
```
1. Run this project locally from the command line.

1. What dependencies does it have (where are they expressed) and how do I install them?
1. Can I see the project working before I change anything?


## Testing

How do I run the project's automated tests?

* Unit Tests

* Integration Tests
```
gcloud preview app run <REPO NAME>/
```

1. Visit the application at [http://localhost:8080](http://localhost:8080).

## Deploying

### How to setup the deployment environment
1. Use the [Cloud Developer Console](https://console.developer.google.com) to create a project/app id. (App id and project id are identical)
2. Configure gcloud with your app id.

* Addons, packages, or other dependencies required for deployment.
* Required environment variables or credentials not included in git.
* Monitoring services and logging.
```
gcloud config set project <your-app-id>
```
1. Use the [Admin Console](https://appengine.google.com) to view data, queues, and other AppEngine specific administration tasks.
1. Use gcloud to deploy your app.

### How to deploy


## Troubleshooting & useful tools

### Examples of common tasks

e.g.
* How to make curl requests while authenticated via oauth.
* How to monitor background jobs.
* How to run the app through a proxy.
```
gcloud preview app deploy <REPO NAME>/
```

1. Congratulations! Your application is now live at your-app-id.appspot.com

## Contributing changes

* See [CONTRIBUTING.md](CONTRIBUTING.md)


## Licensing

* See [LICENSE](LICENSE)
18 changes: 18 additions & 0 deletions app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file specifies your Python application's runtime configuration
# including URL routing, versions, static file uploads, etc. See
# https://developers.google.com/appengine/docs/python/config/appconfig
# for details.

version: 1
runtime: python27
api_version: 1
threadsafe: yes

# Handlers define how to route requests to your application.
handlers:

# This handler tells app engine how to route requests to a WSGI application.
# The script value is in the format <path.to.module>.<wsgi_application>
# where <wsgi_application> is a WSGI application object.
- url: .* # This regex directs all routes to main.app
script: main.app
14 changes: 14 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

0 comments on commit 4f0504c

Please sign in to comment.