Skip to content

config.py vs development.yaml #61

Open

Description

@Allin2000

Which is the best practice?

Activity

  1. ItayTheDar commented on May 24, 2024

    @ItayTheDar
    Contributor

    Hi! Not sure what is the dev yaml file you suggested, could you share more on that??

  2. Allin2000 commented on May 24, 2024

    @Allin2000
    Author

    Environment-aware configuration.
    What I mean by this is that configuration should be a best practice for a production environment.

  3. ItayTheDar commented on Sep 30, 2026

    @ItayTheDar
    Contributor

    For the current PyNest examples, use config.py to construct the database provider and read environment-specific values from environment variables (.env for local development). For example, examples/OrmSyncApp/src/config.py calls load_dotenv() and reads SQLITE_DB_NAME via os.getenv. The async example follows the same pattern.

    A development.yaml file is fine for non-secret defaults if your application chooses to load one, but PyNest does not currently prescribe or automatically load a development YAML configuration. For production, supply environment variables through your deployment environment and keep credentials out of committed YAML files. This is a recommendation based on the current examples, not a framework requirement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions