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

Add support for channels configuration #266

Closed
fkromer opened this issue Jul 23, 2020 · 3 comments
Closed

Add support for channels configuration #266

fkromer opened this issue Jul 23, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@fkromer
Copy link

fkromer commented Jul 23, 2020

Would be great to have support for channel layer configuration in django-environ 😏 The in-memory channel layer config is pretty simple. The channel_redis config one is more interesting.

@AstraLuma
Copy link

please, this is rapidly becoming extremely annoying.

@sergeyklay sergeyklay self-assigned this Aug 31, 2021
@sergeyklay sergeyklay added the enhancement New feature or request label Aug 31, 2021
@kevinrenskers
Copy link

That would be really nice to have. As I workaround I did it like this, but hopefully there's a better solution?

env = environ.Env(
    DEBUG=(bool, False),
    CI=(bool, False),
)

if env("CI"):
    CHANNEL_LAYERS = {
        "default": {"BACKEND": "channels.layers.InMemoryChannelLayer"},
    }
else:
    CHANNEL_LAYERS = {
        "default": {
            "BACKEND": "channels_redis.core.RedisChannelLayer",
            "CONFIG": {
                "hosts": [("127.0.0.1", 6379)],
            },
        },
    }

@sergeyklay
Copy link
Collaborator

Implemented in #514. Thank you for contributing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants