Skip to content
Discussion options

You must be logged in to vote

I'll, partially, answer myself: I do not know if you can work with temporal files, but you can make use of the io module; here is a snippet:

import io

env_file_content = """\
VAR_1=foo
VAR_2=bar
"""

files.put(
    src=io.StringIO(env_file_content),
    dest="/path/to/.env",
)

This will put/upload the content of env_file_content to a file on the server. Of course, you can do variable interpolation, make use of Pydantic Settings, environment variables, etc.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Fizzadar
Comment options

Answer selected by Fizzadar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants