https://github.com/sparkpost/appengine-std-python-sample
Sample app using Python, Flask and SparkPost in the Google App Engine standard environment
https://github.com/sparkpost/appengine-std-python-sample
google-appengine python sparkpost
Last synced: 22 days ago
JSON representation
Sample app using Python, Flask and SparkPost in the Google App Engine standard environment
- Host: GitHub
- URL: https://github.com/sparkpost/appengine-std-python-sample
- Owner: SparkPost
- License: other
- Created: 2017-04-12T10:51:01.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-03-27T19:55:07.000Z (almost 8 years ago)
- Last Synced: 2024-12-29T11:49:27.501Z (about 1 year ago)
- Topics: google-appengine, python, sparkpost
- Language: Python
- Size: 4.88 KB
- Stars: 0
- Watchers: 9
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
[Sign up](https://app.sparkpost.com/join?src=Dev-Website&sfdcid=70160000000pqBb) for a SparkPost account and visit our [Developer Hub](https://developers.sparkpost.com) for even more content.
This sample app demonstrates how to send email with Python and [python-sparkpost](https://github.com/SparkPost/python-sparkpost) on the Google App Engine standard environment.
### Prerequisites
- a [Google Cloud Platform](https://cloud.google.com/) account
- the [Google Cloud SDK](https://cloud.google.com/sdk/) installed and configured
### Setup
1. Sign up for a SparkPost account [here](https://app.sparkpost.com/join).
1. Create an API key with *Transmissions: read/write* privilege [here](https://app.sparkpost.com/account/credentials).
1. Add your API key to `app.yaml`.
1. Install the app's dependencies:
```sh
mkdir lib
pip install -r requirements -t lib
```
### Running Locally
1. Run the app using the Google Cloud SDK dev app server:
```sh
$GCLOUD_SDK/bin/dev_appserver.py app.yaml
```
1. Visit the app in your browser: [http://localhost:8080/](http://localhost:8080/)
### Deploying To Google App Engine
1. Deploy the app and dependencies to your Google Cloud project:
```sh
gcloud app deploy
```
1. Visit the app in your browser:
```sh
gcloud app browse
```
### Running The Tests
```sh
pip install pytest responses flaky
pytest main_test.py
```