uccser/cs-field-guide

View on GitHub
csfieldguide/config/context_processors/deployed.py

Summary

Maintainability
A
0 mins
Test Coverage
"""Context processor for checking if in deployed environment."""

from django.conf import settings


def deployed(request):
    """Return a dictionary containing booleans regarding deployed environment.

    Returns:
        Dictionary containing deployed booleans to add to context.
    """
    return {
        "DEPLOYED": settings.DEPLOYED,
        "PRODUCTION_ENVIRONMENT": settings.PRODUCTION_ENVIRONMENT,
        "STAGING_ENVIRONMENT": settings.STAGING_ENVIRONMENT,
    }