You can detect things about your running environment by using the utility functions located in djangae.environment, and djangae.tasks.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 Google Cloud Platform project ID for wherever the code is deployed (or the
default if running locally).
This replaces the old
Returns the root folder of your application (this is the folder containing app.yaml)
For the task-specific environment functions and decorators to work, you must add
djangae.tasks.middleware.TaskEnvironmentMiddleware to your
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
Returns the Cloud Tasks location ID based on the App Engine application ID. This uses an internal mapping between application ID prefix, and Cloud Tasks location.
View decorator to allow restricting views to tasks (including crons) or admins of the application.
View decorator that allows through tasks, or users with
is_superuser == True
View decorator that marks the view csrf_exempt only if it's being requested by Cloud Tasks