https://prefect.io logo
Title
s

Samuel Hinton

02/23/2023, 2:26 AM
Another question - what is the best practise about setting PREFECT_API_URL from code?
prefect.settings.PREFECT_API_URL
has getters but not setters and I dont want to just go under the hood. Using
os.environ
doesnt seem to work, because the env var is set after importing prefect (use case is we have dev and prod versions of prefect and we want to loop over envs and upload a common flow to all of them)
n

Nate

02/23/2023, 2:35 AM
hi @Samuel Hinton checking out the implementation of `temporary_settings` might be useful for you (or it might even work itself for your use case)
s

Samuel Hinton

02/23/2023, 2:37 AM
Ah yeah, that looks like it’ll do the trick, thanks mate!
👍 1