Skip to content

Can't use URL and PASSWORD in the config at the same time #566

Open
@dschmide

Description

@dschmide

When defining a password and URL in the config, only the URL will be used

The following config will not work as expected, no password will be used.

config = {
'CACHE_TYPE': 'RedisCache',
'CACHE_REDIS_URL': 'redis://localhost:6379/0',
'CACHE_REDIS_PASSWORD': 'test'
}

It is unintuitive that the password is ignored even though it is defined in the config. If this is intended, the documentation should reflect that the URL always takes precedence and parameters that are defined by the URL are ignored (such as host, port, db and password).
Maybe the individual parameters should be dropped entirely in favor of using the URL as the only way to make a connection to avoid confusion, or a warning should be thrown when both parameters are used at the same time.

Environment:

  • Python version: 3.9
  • Flask-Caching version: 2.3.0

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions