Skip to content

Support prefix in environ.Env #362

Closed
@arturponinski

Description

@arturponinski
Contributor

Sometimes it is desirable to be able to prefix all environment variables. pydantic offers this in this manner:

    class Config:
        env_prefix = 'my_prefix_'  # defaults to no prefix, i.e. ""

Ideally, something like this can be implemented:

import environ

env = environ.Env()
env.prefix = "PREFIX_"

Activity

ecugol

ecugol commented on Feb 6, 2022

@ecugol

Just thought about the same thing. Could be very useful for multiple apps running on the same env.

jayvdb

jayvdb commented on Apr 13, 2022

@jayvdb

This is a feature of environs which is quite handy.
https://github.com/sloria/environs#handling-prefixes

self-assigned this
on Jun 13, 2022
sergeyklay

sergeyklay commented on Jun 13, 2022

@sergeyklay
Collaborator

Implemented in #363

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

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @jayvdb@ecugol@sergeyklay@arturponinski

      Issue actions

        Support prefix in environ.Env Β· Issue #362 Β· joke2k/django-environ