Plain is headed towards 1.0! Subscribe for development updates →

 1import os
 2
 3from dotenv import load_dotenv
 4
 5from .debug import set_breakpoint_hook
 6
 7
 8def setup():
 9    # Make sure our clis are registered
10    # since this isn't an installed app
11    from .cli import cli  # noqa
12    from .precommit import cli  # noqa
13    from .contribute import cli  # noqa
14
15    # Try to set a new breakpoint() hook
16    # so we can connect to pdb remotely.
17    set_breakpoint_hook()
18
19    # Load environment variables from .env file
20    if plain_env := os.environ.get("PLAIN_ENV", ""):
21        load_dotenv(f".env.{plain_env}")
22    else:
23        load_dotenv(".env")