Skip to content

Channel layer object empty #55

Description

@igmt

Hi, really like your project.
I'm trying to get this working on my dev environment but I keep getting an empty Channel layer object.

I added the needed config, see below and ran migrations (which worked), but below code will return None.

from channels.layers import get_channel_layer
c = get_channel_layer()
print(c) #prints None

Below part of my config:

DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.postgresql",
        "NAME": "postgres",
        "USER": "postgres",
        "PASSWORD": "postgres",
        "HOST": "postgres",
    },
    "channels_postgres": {
        "ENGINE": "django.db.backends.postgresql",
        "NAME": "postgres",
        "USER": "postgres",
        "PASSWORD": "postgres",
        "HOST": "postgres",
        "PORT": "5432",
    }
}

CHANNEL_LAYERS = {
    "default": {
        "BACKEND": "channels_postgres.core.PostgresChannelLayer",
        "CONFIG": {
            "ENGINE": "django.db.backends.postgresql",
            "NAME": "postgres",
            "USER": "postgres",
            "PASSWORD": "postgres",
            "HOST": "postgres",
            "PORT": "5432",
        }
    }
}

Part of requirements.txt

channels==4.2.2
channels-redis==4.2.0
channels-postgres==1.1.2

Guess it is something stupid I'm missing :)

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions