Login

Tag "appengine"

Snippet List

Managing Google AppEngine datastore maintenance

This code defines a decorator that inform users of your site when the Google AppEngine data store is in read-only mode during maintenance periods. Use it as a decorator on your views that require write access to the data store. @requires_datastore_write def update(request): ... Create a `maintenance.html` Django template (or change the name in the code) with the message that the user will see, something like: This application is currently in maintenance mode and some operations are temporarily unavailable. Thanks for trying back later. Sorry for the inconvenience.

  • decorator
  • readonly
  • appengine
  • maintenance
  • capabilities
  • datastore
Read More

ImageField for Google App Engine

This is a replacement for Django's built-in ImageField. It uses the Google AppEngine image APIs in order to validate. Notes: 1. Validation of the field counts against your App Engine transformations quota. 2. This code assumes you're only using the in-memory file upload handler. None of the other stock handlers work well on App Engine; you should probably disable them.

  • fields
  • imagefield
  • google
  • appengine
  • gae
Read More

HTML/JS template filter to show localized dates/times

While working on my website projects today I had the idea to use HTML/JS instead of a IP database to localize the dates and times shown on the websites. Here are the snippets to use the JS snippets as filters for Django running on Google App Engine. You can use those filters on datetime objects.

  • template
  • filter
  • django
  • datetime
  • date
  • time
  • appengine
  • local
Read More

Accepting and processing PayPal IPN messages (including using App Engine)

PayPal's [https://www.paypal.com/ipn](IPN mechanism) is ridiculously easy to consume. You can tell PayPal to POST every single transaction on your account to a URL somewhere, then set up a handler at that URL which processes those transactions in some way. Security is ensured by POSTing the incoming data back to PayPal for confirmation that the transaction is legitimate. These classes are probably over-engineered, but they were a fun experiment in creating class-based generic views.

  • appengine
  • paypal
  • payment
  • ipn
Read More

5 snippets posted so far.