Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardizing the App Engine readmes. 2/3rds of #137. #140

Merged
merged 1 commit into from
Nov 11, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions appengine/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Google App Engine Samples

This section contains samples for [Google Cloud Storage](https://cloud.google.com/storage). Most of these samples have associated documentation that is linked
within the docstring of the sample itself.

## Running the samples locally

1. Download the [Google App Engine Python SDK](https://cloud.google.com/appengine/downloads) for your platform.
2. Many samples require extra libraries to be installed. If there is a `requirements.txt`, you will need to install the dependencies with [`pip`](pip.readthedocs.org).

pip install -t lib -r requirements.txt

3. Use `dev_appserver.py` to run the sample:

dev_appserver.py app.yaml

4. Visit `http://localhost:8080` to view your application.

Some samples may require additional setup. Refer to individual sample READMEs.

## Deploying the samples

1. Download the [Google App Engine Python SDK](https://cloud.google.com/appengine/downloads) for your platform.
2. Many samples require extra libraries to be installed. If there is a `requirements.txt`, you will need to install the dependencies with [`pip`](pip.readthedocs.org).

pip install -t lib -r requirements.txt

3. Use `appcfg.py` to deploy the sample, you will need to specify your Project ID and a version number:

appcfg.py update -A your-app-id -V your-version app.yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know appcfg is recommended but I feel we could give a shoutout to gcloud as the way forward?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for non-managed VMs.


4. Visit `https://your-app-id.appost.com` to view your application.

## Additional resources

For more information on App Engine:

> https://cloud.google.com/appengine

For more information on Python on App Engine:

> https://cloud.google.com/appengine/docs/python
44 changes: 3 additions & 41 deletions appengine/angular/README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,5 @@
## App Engine AngularJS "Hello World" Python
## App Engine & Angular JS

A simple [AngularJS](http://angularjs.org/) CRUD application
for [Google App Engine](https://appengine.google.com/).
A simple [AngularJS](http://angularjs.org/) CRUD application for [Google App Engine](https://appengine.google.com/).

Author: Fred Sauer <[email protected]>


## Project setup

1. Install the [App Engine Python SDK](https://developers.google.com/appengine/downloads)


## Testing the app locally

To run the app locally:

```
dev_appserver.py .
```


## Deploying

To deploy the application:

1. Use the [Google Cloud Console](https://cloud.google.com/console) to create a project
1. Replace `your-app-id` in `app.yaml` with the project id from the previous step
1. Deploy the application:

```
appcfg.py --oauth2 update .
```


## Contributing changes

See [CONTRIB.md](CONTRIB.md)


# Licensing

See [LICENSE](LICENSE)
Refer to the [App Engine Samples README](../README.md) for information on how to run and deploy this sample.
24 changes: 5 additions & 19 deletions appengine/bigquery/README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,11 @@
## Google App Engine accessing BigQuery using OAuth2
# Google App Engine accessing BigQuery using OAuth2

This sample demonstrates [authenticating to BigQuery in App Engine using OAuth2](https://cloud.google.com/bigquery/authentication).

### Running the sample
Refer to the [App Engine Samples README](../README.md) for information on how to run and deploy this sample.

1. To install dependencies for this sample, run:
## Setup

$ pip install -t lib -r requirements.txt
1. You'll need a client id for your project. Follow [these instructions](https://cloud.google.com/bigquery/authentication#clientsecrets). Once you've downloaded the client's json secret copy it into the sample directory and rename it to `client_secrets.json`.

2. You must then update `main.py` and replace `<your-project-id>` with your project's
ID.

3. You'll need a client id from your project - instructions
[here](https://cloud.google.com/bigquery/authentication#clientsecrets).
Once you've downloaded the client's json secret, copy it to the root directory
of this project, and rename it to `client_secrets.json`.

3. You can then run the sample on your development server:

$ dev_appserver.py .

Or deploy the application:

$ appcfg.py update .
2. Update `main.py` and replace `<your-project-id>` with your project's ID.
14 changes: 6 additions & 8 deletions appengine/cloudsql/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# Using Cloud SQL from Google App Engine

This is an example program showing how to use the native MySQL connections from Google App Engine to Google Cloud SQL.
This is an example program showing how to use the native MySQL connections from Google App Engine to [Google Cloud SQL](https://cloud.google.com/sql).

## Running the sample
Refer to the [App Engine Samples README](../README.md) for information on how to run and deploy this sample.

1. Edit the `CLOUDSQL_INSTANCE` and `CLOUDSQL_PROJECT` values in `main.py`.
## Setup

2. If you have a local MySQL instance, run the app locally:
1. You will need to create a [Cloud SQL instance](https://cloud.google.com/sql/docs/create-instance).

dev_appserver.py .
2. Edit the `CLOUDSQL_INSTANCE` and `CLOUDSQL_PROJECT` values in `main.py`.

2. Upload the app:

appcfg.py update .
3. To run locally, you will need to be running a local instance of MySQL. You may need to update the connection code in `main.py` with the appropriate local username and password.
8 changes: 5 additions & 3 deletions appengine/i18n/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# App Engine Internationalization sample in Python
# App Engine Internationalization Sample

A simple example app showing how to build an internationalized app
with App Engine. The main purpose of this example is to provide the
basic how-to.
with App Engine.

## What to internationalize

Expand Down Expand Up @@ -93,6 +92,9 @@ Open `locales/ja/LC_MESSAGES/jsmessages.po` and translate it.

$ pybabel compile -d locales -D jsmessages

### Running locally & deploying

Refer to the [App Engine Samples README](../README.md) for information on how to run and deploy this sample.

## How it works

Expand Down
66 changes: 2 additions & 64 deletions appengine/images/README.md
Original file line number Diff line number Diff line change
@@ -1,68 +1,6 @@
## Images Guestbook Sample

This is a sample app for Google App Engine that exercises the [images
Python
This is a sample app for Google App Engine that demonstrates the [Images Python
API](https://cloud.google.com/appengine/docs/python/images/usingimages).

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).

1. Setup the gcloud tool.
```
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.
```
git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git
cd appengine/images/
```

1. Run this project locally from the command line.
```
gcloud preview app run ./app.yaml
```

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

## Deploying

1. Use the [Cloud Developer
Console](https://console.developer.google.com) to create a
project/app id. (App id and project id are identical)

1. Configure gcloud with your app id.
```
gcloud config set project <your-app-id>
```

1. Use the [Admin Console](https://appengine.google.com) to view data,
queues, and other App Engine specific administration tasks.

1. Use gcloud to deploy your app.
```
gcloud preview app deploy ./app.yaml
```

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

## Contributing changes

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

## Licensing

* See [LICENSE](/LICENSE)
Refer to the [App Engine Samples README](../README.md) for information on how to run and deploy this sample.
12 changes: 12 additions & 0 deletions appengine/mailgun/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Mailgun & Google App Engine

This sample application demonstrates how to use [Mailgun with Google App Engine](https://cloud.google.com/appengine/docs/python/mail/mailgun).

Refer to the [App Engine Samples README](../../README.md) for information on how to run and deploy this sample.

# Setup

Before running this sample:

1. You will need a [Mailgun account](http://www.mailgun.com/google).
2. Update the `MAILGUN_DOMAIN_NAME` and `MAILGUN_API_KEY` constants in `main.py`. You can use your account's sandbox domain.
58 changes: 3 additions & 55 deletions appengine/memcache/guestbook/README.md
Original file line number Diff line number Diff line change
@@ -1,57 +1,5 @@
## Memcache Guestbook Sample
# Memcache Guestbook Sample

This is a sample app for Google App Engine that exercises the [memcache Python API](https://cloud.google.com/appengine/docs/python/memcache/usingmemcache).
This is a sample app for Google App Engine that demonstrates the [Memcache Python API](https://cloud.google.com/appengine/docs/python/memcache/usingmemcache).

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.

```
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.

```
git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git
cd appengine/memcache/guestbook/
```
1. Run this project locally from the command line.

```
gcloud preview app run ./app.yaml
```

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

## Deploying

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.

```
gcloud config set project <your-app-id>
```
1. Use the [Admin Console](https://appengine.google.com) to view data, queues, and other App Engine specific administration tasks.
1. Use gcloud to deploy your app.

```
gcloud preview app deploy ./app.yaml
```

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

## Contributing changes

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

## Licensing

* See [LICENSE](../../../LICENSE)
Refer to the [App Engine Samples README](../../README.md) for information on how to run and deploy this sample.
14 changes: 3 additions & 11 deletions appengine/multitenancy/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
## Google App Engine Namespaces
# Google App Engine Namespaces

This sample demonstrates how to use Google App Engine's [Namespace Manager API](https://cloud.google.com/appengine/docs/python/multitenancy/multitenancy) in Python.
This sample demonstrates how to use Google App Engine's [Namespace Manager API](https://cloud.google.com/appengine/docs/python/multitenancy/multitenancy).

### Running the sample

You can run the sample on your development server:

$ dev_appserver.py .

Or deploy the application:

$ appcfg.py update .
Refer to the [App Engine Samples README](../README.md) for information on how to run and deploy this sample.
58 changes: 0 additions & 58 deletions appengine/ndb/README.md

This file was deleted.

7 changes: 3 additions & 4 deletions appengine/ndb/modeling/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
appengine-ndb-snippets
======================
## App Engine Datastore NDB Modeling Samples

= modeling
These samples demonstrate how to [model entity relationships](https://cloud.google.com/appengine/articles/modeling]) using the Datastore NDB library.

Sample code for (Modeling Entity Relationships)[https://cloud.google.com/appengine/articles/modeling].
Refer to the [App Engine Samples README](../../README.md) for information on how to run and deploy this sample.
Loading