25 lines
517 B
Python
25 lines
517 B
Python
|
|
from enum import Enum
|
||
|
|
|
||
|
|
|
||
|
|
class Environment(str, Enum):
|
||
|
|
LOCAL = "LOCAL"
|
||
|
|
TESTING = "TESTING"
|
||
|
|
STAGING = "STAGING"
|
||
|
|
PRODUCTION = "PRODUCTION"
|
||
|
|
|
||
|
|
@property
|
||
|
|
def is_debug(self):
|
||
|
|
return self in (self.LOCAL, self.STAGING, self.TESTING)
|
||
|
|
|
||
|
|
@property
|
||
|
|
def is_local(self):
|
||
|
|
return self is Environment.LOCAL
|
||
|
|
|
||
|
|
@property
|
||
|
|
def is_testing(self):
|
||
|
|
return self == self.TESTING
|
||
|
|
|
||
|
|
@property
|
||
|
|
def is_deployed(self) -> bool:
|
||
|
|
return self in (self.STAGING, self.PRODUCTION)
|