jrief / django-websocket-redis

Websockets for Django applications using Redis as message queue
http://django-websocket-redis.awesto.com/
MIT License
895 stars 222 forks source link

Allow WS4REDIS_PROCESS_REQUEST to be a string #233

Closed gtnx closed 7 years ago

gtnx commented 7 years ago

refs #232

If WS4REDIS_PROCESS_REQUEST, the string is considered as a path and django.utils.module_loading.import_string (or import_by_path for older version) is used to do so.

jrief commented 7 years ago

just for curiosity, what's your usecase?

gtnx commented 7 years ago

Defining WS4REDIS_PROCESS_REQUEST directly with the function in the settings.py may require some import from django modules. If the function is defined in a models.py file, this would aise a django.core.exceptions.AppRegistryNotReady. You have many ways to solve this: defining it another file, modify the settings after the app are loaded but this seemed to me pretty simple and "django-compliant".