We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This works as expected:
>>> Env.db_url_config("custom.backend://user:password@example.com:5430/database") {'NAME': 'database', 'USER': 'user', 'PASSWORD': 'password', 'HOST': 'example.com', 'PORT': 5430, 'ENGINE': 'custom.backend'}
Doesn't work:
>>> Env.db_url_config("some_custom.backend://user:password@example.com:5430/database") /usr/local/lib/python3.7/site-packages/environ/environ.py:437: UserWarning: Engine not recognized from url: {'NAME': 'ome_custom.backend://user:password@example.com:5430/database', 'USER': '', 'PASSWORD': '', 'HOST': '', 'PORT': '', 'ENGINE': ''} warnings.warn("Engine not recognized from url: {0}".format(config)) {}
>>> Env.db_url_config("custom.some_backend://user:password@example.com:5430/database") /usr/local/lib/python3.7/site-packages/environ/environ.py:437: UserWarning: Engine not recognized from url: {'NAME': 'ustom.some_backend://user:password@example.com:5430/database', 'USER': '', 'PASSWORD': '', 'HOST': '', 'PORT': '', 'ENGINE': ''} warnings.warn("Engine not recognized from url: {0}".format(config)) {}
The text was updated successfully, but these errors were encountered:
I confirm the bug under;
This might be a Py compatibility issue. I think url parsing fails at environ.py L#375
Sorry, something went wrong.
Same issue here.
In the meantime, I went around the issue by monkey patching the Env class to add my own database scheme this way:
Env
from environ import Env Env.DB_SCHEMES['mybackend'] = 'some_custom.backend' Env.db_url_config('mybackend://user:password@example.com:5430/database') # {'NAME': 'database', 'USER': 'user', 'PASSWORD': 'password', 'HOST': 'example.com', 'PORT': 5430, 'ENGINE': 'some_custom.backend'}
For what is worth, I tried to make it a bit cleaner by subclassing Env to make my own subclass like so:
from environ import Env class ExtendedEnv(Env): DB_SCHEMES = { **Env.DB_SCHEMES, 'mybackend': 'some_custom.backend', }
However it doesn't work since Env.db_url_config uses Env.DB_SCHEMES and not cls.DB_SCHEMES so you have to modify Env.DB_SCHEMES in place 😢
Env.db_url_config
Env.DB_SCHEMES
cls.DB_SCHEMES
Merge pull request joke2k#202 from blueyed/coverage-subprocess
52a8632
coverage: track subprocesses
No branches or pull requests
This works as expected:
Doesn't work:
The text was updated successfully, but these errors were encountered: