W

webapptitude

A few extensions on webapp2 to accelerate development on Google AppEngine

Name Last Update
docs Loading commit data...
templates Loading commit data...
test Loading commit data...
webapptitude Loading commit data...
.gitignore Loading commit data...
.gitlab-ci.yml Loading commit data...
INSTALLING.md Loading commit data...
LICENSE Loading commit data...
MANIFEST.in Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
__init__.py Loading commit data...
queue.yaml Loading commit data...
requirements.txt Loading commit data...
requirements_test.txt Loading commit data...
setup.cfg Loading commit data...
setup.py Loading commit data...

A utility library for Google AppEngine

build status pypi package pypi downloads

This library provides a number of common utilities, decorators, and conveniences to simplify development of applications on Google AppEngine (in Python).

The problem: webapp2 provides a fantastic number of very flexible features, but they often require a degree of custom code that just gets annoying, especially considering Python's refrain of "don't repeat yourself."

This library enables many of those features by default, with sensible default settings, and provides easy access to the essential interfaces.

Components

This project's documentation is broken into several components.

  1. Basic Usage Application fundamentals
  2. JSON API extensions Building an API service
  3. HTTP Digest Authentication Secure authentication within the app
  4. Google Analytics API kit Reusable components for the Analytics V4 API
  5. BigQuery API kit Sensible object abstraction on BigQuery datasets
  6. Testing Your Application Simplifying the test architecture
  7. Go with the Flow Procedural, stateful out-of-band workflow tooling.

Installation

  1. Install Google AppEngine from AppEngine Downloads
  2. In your project directory, install the Webapptitude library to your local vendor libraries path (often lib).
  3. Configure your project's appengine_config.py to load vendor libraries.

Step 2: installing vendor library

Perhaps the simplest approach: install the library in a one-shot command to the target lib directory.

pip install -t lib webapptitude

It's recommended to append the package to your projects requirements.txt file so pip can manage them reporducibly in the future.

Your requirements.txt file would then look something like this:

# other libraries you might need...
Markdown==2.5.2
webapptitude

You can then install all required packages more reliably:

pip install -t lib -r requirements.txt

Step 3: configure your application

In your appengine_config.py, placed in project root, the following code enables your application to use libaries/modules from a path lib within the project. This is generally required for applications which depend on third-party libraries that Google doesn't already provide.

from google.appengine.ext import vendor

# Add any libraries installed in the "lib" folder.
vendor.add('lib')

AppEngine also provides several versions of various libraries. This can cause confusion when a feature in a newer version is absent from an older version, and the application may (automatically) select an older version of the library. Because Webapptitude aims to address modern development needs, we prefer to target the latest versions of these dependencies.

Recommend adding the following specification to application configs:

libraries:
- name: yaml
  version: latest
- name: webob
  version: latest
- name: webapp2
  version: latest
- name: jinja2
  version: latest
- name: django
  version: latest

The application configuration files include:

  • app.yaml
  • all modules noted by dispatch.yaml, their respective yaml files.