Thanks to visit codestin.com
Credit goes to github.com

Skip to content

How do I pass environment variables to my route files? #399

@unography

Description

@unography

From the example given here - https://fastapi.tiangolo.com/tutorial/bigger-applications/

I have this kind of structure.

.
├── app
│   ├── __init__.py
│   ├── main.py
│   └── routers
│       ├── __init__.py
│       ├── items.py
│       └── users.py

I would like to read environment variables, when running/deploying my code, and then pass those variables to items.py and users.py

How do I achieve this?

Do I have to use tags or is that for some other purpose?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions