You can detect things about your running environment by using the utility functions located in djangae.environment.
Returns if the request is currently running on the live GAE servers
Returns whether or not the code is running on the local development environment
Returns the application id from app.yaml (or wherever the code is deployed)
Returns the root folder of your application (this is the folder containing app.yaml)
Returns the current task name if the code is running on a task queue
Returns the current task queue name if the code is running on a task queue
Returns true if the code is running in a task on the task queue
Returns the number of times the task has retried, or 0 if the code is not running on a queue
View decorator to allow restricting views to tasks (including crons) or admins of the application.