Initial commit
This commit is contained in:
commit
376a7a9fe5
71 changed files with 2326 additions and 0 deletions
36
src/constants.py
Normal file
36
src/constants.py
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
"""
|
||||
Global constants
|
||||
|
||||
Classes:
|
||||
- Environment(StrEnum): LOCAL, TESTING, STAGING, PRODUCTION
|
||||
"""
|
||||
from enum import StrEnum, auto
|
||||
|
||||
|
||||
class Environment(StrEnum):
|
||||
"""
|
||||
Enumeration of environments.
|
||||
|
||||
Attributes:
|
||||
LOCAL (str): Application is running locally
|
||||
TESTING (str): Application is running in testing mode
|
||||
STAGING (str): Application is running in staging mode (ie not testing)
|
||||
PRODUCTION (str): Application is running in production mode
|
||||
"""
|
||||
|
||||
LOCAL = auto()
|
||||
TESTING = auto()
|
||||
STAGING = auto()
|
||||
PRODUCTION = auto()
|
||||
|
||||
@property
|
||||
def is_debug(self):
|
||||
return self in (self.LOCAL, self.STAGING, self.TESTING)
|
||||
|
||||
@property
|
||||
def is_testing(self):
|
||||
return self == self.TESTING
|
||||
|
||||
@property
|
||||
def is_deployed(self) -> bool:
|
||||
return self in (self.STAGING, self.PRODUCTION)
|
||||
Loading…
Add table
Add a link
Reference in a new issue