A Python-Flask-Google App Engine project bootstrapped from https://github.com/GoogleCloudPlatform/appengine-flask-skeleton
To customize this project, you'll have to set up your own Google App Engine project in the Google Developers Console.
-
Clone this repository.
-
Use the Google Developers Console to create a project, with a unique app id. For purposes of this README, we use "gafe-conferences" as the app id. (App id and project id are identical)
-
Go to the API Manager section. On the APIs tab, Enable the Calendar, Google+ and Gmail APIs. On the Credentials tab, click "Add credentials" and create an OAuth 2.0 client ID. Add "http://localhost:8080" to the "Authorized Javascript origins" and "http://localhost:8080/oauth2callback" to the "Authorized redirect URIs".
Click the "Download JSON" button, rename the downloaded .json file to "client_secrets.json", and save it in the top level folder of your local repository. -
[Possibly Add credentials for a "Service account" and download the JSON credentials to "service_account.json" in the top level folder of the repository.]
-
On the "OAuth consent screen" tab, supply your email address and a display name for your app, like "My District GAFE Conference Manager". Add other information as necessary.
-
[Possibly verify your domain if you want to receive Calendar push notifications]
-
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.
-
Customize the "config-sample.py" file and save it as "config_dev.py" in the top level folder of the repository.
-
Install dependencies in the project's lib directory. Note: App Engine can only import libraries from inside your project directory.
cd <project directory> rm -rf lib/* pip install -r requirements.txt -t lib
-
Run the project locally from the command line:
dev_appserver.py -A gafe-conferences --smtp_host=your.mail.host.com --smtp_port=25 app.yaml
or, if you want to empty a messed up datastore
dev_appserver.py -A gafe-conferences --smtp_host=your.mail.host.com --smtp_port=25--clear_datastore yes app.yaml
Congratulations, your project should be running now!
Visit the application http://localhost:8080
See the development server documentation for options when running dev_appserver.
To deploy the application on appspot.com:
-
In the Google Developers Console console, add the appspot.com URIs for the "Authorized Javascript origins" and "Authorized redirect URIs".
-
Modify the config_gae.py file with the appropriate debugging levels, protocol, hostname, and port.
-
Deploy the application with:
appcfg.py -A gafe-conferences --oauth2 update .
Congratulations! Your application is now live at gafe-conferences.appspot.com
When executing the OAuth2WebServerFlow callback, I was getting this error in the GAE logs:
FeatureNotEnabledError: The Socket API will be enabled for this application once billing has been enabled in the admin console.
The exception was thrown as a result of setting the environment variable
GAE_USE_SOCKETS_HTTPLIB in app.yaml. Removing it now seems to work for both the
dev_appserver and hosted Google App Engine.
Star this repo if you found it useful. Use the github issue tracker to give feedback on this repo.
See CONTRIB.md for information on developing apps on top of the Google Cloud Platform. If you have contributions or feature requests on the GAFE Conference Manager project, please email the author, Peter Zingg, at pzingg -at- kentfieldschools -dot- org.
For information on the Python Flask Skeleton for Google App Engine, a skeleton for building Python applications on Google App Engine with the Flask micro framework and other related projects, see the Google Cloud Platform github repos.
See LICENSE
Python Flask Skeleton for Google App Engine: Logan Henriquez and Johan Euphrosine
GAFE Conference Manager: Peter Zingg