diff --git a/appengine/README.md b/appengine/README.md new file mode 100644 index 000000000000..d95a5e6d8fe2 --- /dev/null +++ b/appengine/README.md @@ -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 + +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 diff --git a/appengine/angular/README.md b/appengine/angular/README.md index 22dab2437490..4e3c3539b858 100644 --- a/appengine/angular/README.md +++ b/appengine/angular/README.md @@ -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 - - -## 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. diff --git a/appengine/bigquery/README.md b/appengine/bigquery/README.md index 5457172fedb1..def5e7c1a617 100644 --- a/appengine/bigquery/README.md +++ b/appengine/bigquery/README.md @@ -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 `` 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 `` with your project's ID. diff --git a/appengine/cloudsql/README.md b/appengine/cloudsql/README.md index 700430841334..a87d4f1e0132 100644 --- a/appengine/cloudsql/README.md +++ b/appengine/cloudsql/README.md @@ -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. diff --git a/appengine/i18n/README.md b/appengine/i18n/README.md index c1ae720e9604..ab982f2b81e8 100644 --- a/appengine/i18n/README.md +++ b/appengine/i18n/README.md @@ -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 @@ -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 diff --git a/appengine/images/README.md b/appengine/images/README.md index dcc66d4ec19d..367db816a5c1 100644 --- a/appengine/images/README.md +++ b/appengine/images/README.md @@ -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 - ``` - 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 - ``` - -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. diff --git a/appengine/mailgun/README.md b/appengine/mailgun/README.md index e69de29bb2d1..2973827801e2 100644 --- a/appengine/mailgun/README.md +++ b/appengine/mailgun/README.md @@ -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. diff --git a/appengine/memcache/guestbook/README.md b/appengine/memcache/guestbook/README.md index c51b3eec8ed5..051f0d4b2fc7 100644 --- a/appengine/memcache/guestbook/README.md +++ b/appengine/memcache/guestbook/README.md @@ -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 - ``` - 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 - ``` -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. diff --git a/appengine/multitenancy/README.md b/appengine/multitenancy/README.md index 5ee7773df9b6..bfc161b18db1 100644 --- a/appengine/multitenancy/README.md +++ b/appengine/multitenancy/README.md @@ -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. diff --git a/appengine/ndb/README.md b/appengine/ndb/README.md deleted file mode 100644 index 56a14bb36325..000000000000 --- a/appengine/ndb/README.md +++ /dev/null @@ -1,58 +0,0 @@ -## NDB Overview Sample - -This is a sample app for Google App Engine that exercises the [NDB Python API](https://cloud.google.com/appengine/docs/python/ndb/). - -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 - ``` - 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 python-docs-samples/datastore/ndb/ - ``` - -1. Run this project locally from the command line. - - ``` - gcloud preview app run ./ - ``` - -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 - ``` -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 ./ - ``` - -1. Congratulations! Your application is now live at your-app-id.appspot.com - -## Contributing changes - -* See [CONTRIBUTING.md](../../CONTRIBUTING.md) - -## Licensing - -* See [LICENSE](../../LICENSE) diff --git a/appengine/ndb/modeling/README.md b/appengine/ndb/modeling/README.md index 47d01fb9ed53..f4d19f5e5865 100644 --- a/appengine/ndb/modeling/README.md +++ b/appengine/ndb/modeling/README.md @@ -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. diff --git a/appengine/ndb/overview/README.md b/appengine/ndb/overview/README.md index 098498d50b88..b32b8a65be19 100644 --- a/appengine/ndb/overview/README.md +++ b/appengine/ndb/overview/README.md @@ -1,57 +1,5 @@ -## NDB Overview Sample +## App Engine Datastore NDB Overview Sample -This is a sample app for Google App Engine that exercises the [NDB Python API](https://cloud.google.com/appengine/docs/python/ndb/). +This is a sample app for Google App Engine that demonstrates the [Datastore NDB Python API](https://cloud.google.com/appengine/docs/python/ndb/). -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 - ``` - 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/datastore-pthon-samples.git - cd datastore-python-samples/ndb-overview - ``` -1. Run this project locally from the command line. - - ``` - gcloud preview app run ./ - ``` - -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 - ``` -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 ./ - ``` - -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. diff --git a/appengine/ndb/transactions/README.md b/appengine/ndb/transactions/README.md index 39c983ae0aca..34a1da4cde7f 100644 --- a/appengine/ndb/transactions/README.md +++ b/appengine/ndb/transactions/README.md @@ -1,61 +1,7 @@ -## NDB Transactions Sample +## App Engine Datastore NDB Transactions Sample -This is a sample app for Google App Engine that exercises the [NDB Transactions Python API](https://cloud-dot-devsite.googleplex.com/appengine/docs/python/ndb/transactions) +This is a sample app for Google App Engine that exercises the [NDB Transactions Python API](https://cloud.google.com/appengine/docs/python/ndb/transactions) This app presents a list of notes. After you submit a note with a particular title, you may not change that note or submit a new note with the same title. There are multiple note pages available. -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 - ``` - 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/datastore-samples.git - cd datastore-samples/python/ndb/transactions - ``` -1. Run this project locally from the command line. - - ``` - pip install -r requirements.txt -t lib/ - 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 - ``` -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. - - ``` - pip install -r requirements.txt -t lib/ - 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. diff --git a/appengine/storage/README.md b/appengine/storage/README.md index 08ae41f2b1af..b934b2f46ab4 100644 --- a/appengine/storage/README.md +++ b/appengine/storage/README.md @@ -1,19 +1,15 @@ -## Google App Engine using Cloud Storage +# Cloud Storage & Google App Engine -This sample demonstrates how to use Google Cloud Storage from Google App Engine +This sample demonstrates how to use the [Google Cloud Storage API](https://cloud.google.com/storage/docs/json_api/) from Google App Engine. -### 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 +Before running the sample: -2. You must then update `main.py` and replace `` with your Cloud Storage bucket. +1. You need a Cloud Storage Bucket. You create one with [`gsutil`](https://cloud.google.com/storage/docs/gsutil): -3. You can then run the sample on your development server: - - $ dev_appserver.py . + gsutil mb gs://your-bucket-name - Or deploy the application: - - $ appcfg.py update . +2. Update `main.py` and replace `` with your Cloud Storage bucket.