Skip to content
New issue

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

redis:// URL host & port configuration #39

Closed
johnfraney opened this issue Dec 12, 2015 · 6 comments
Closed

redis:// URL host & port configuration #39

johnfraney opened this issue Dec 12, 2015 · 6 comments

Comments

@johnfraney
Copy link

A redis:// URL is a great shorthand for redis hostname & port settings, and it can easily be stored in an environment variable. It's very handy for Docker/Dokku deployments and is used in other Django + redis libraries (Celery, django-redis)

Rather than:

...
        "HOSTS": [("redis-channel-1", 6379), ("redis-channel-2", 6379)],
...

It would look like this:

...
        "HOSTS": ["redis://redis-channel-1:6379/0", "redis://redis-channel-2:6379/0"],
...
@andrewgodwin
Copy link
Member

Yes, this might be a good idea. I was trying to standardise the format of HOSTS across other potential backends, but there aren't any others with host support yet.

Might just be worth having both supported, they're easy to distinguish programmatically.

@johnfraney
Copy link
Author

Choice is always good! The current (host, port) tuple is sensible. The redis:// support would be nice, though, especially in deployment scenarios that provide a redis:// URL (like dokku-redis).

@bastianh
Copy link
Contributor

I think it's at least important to be able to add the database number for the redis server, since people might host more then one django app on the same server.

@andrewgodwin
Copy link
Member

Did antirez back down on his plan to drop the database numbers?

@bastianh
Copy link
Contributor

database numbers are only deprecated for redis-cluster. Alternatively some kind of namespacing the keys would be possible ?

@andrewgodwin
Copy link
Member

There's already a "PREFIX" setting that can be configured for the backend, it's just not documented yet.

andrewgodwin added a commit that referenced this issue Dec 16, 2015
Fixed #39: Allow redis:// URL redis configuration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants