Replies: 1 comment
-
Have you installed gevent and gevent-websocket on your virtualenv? They are required to use the gevent async mode. You may also need to monkey patch the standard library so that your Django app runs well under gevent. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Why am I having this issue while using python-socketio for django
Exception in thread django-main-thread:
Traceback (most recent call last):
File "C:\Users\Someone\AppData\Local\Programs\Python\Python38-32\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "C:\Users\Someone\AppData\Local\Programs\Python\Python38-32\lib\threading.py", line 870, in run
self._target(self._args, **self.kwargs)
File "C:\Users\Someone\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "C:\Users\Someone\AppData\Local\Programs\Python\Python38-32\lib\site-packages\channels\management\commands\runserver.py", line 75, in inner_run
self.check(display_num_errors=True)
File "C:\Users\Someone\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\core\management\base.py", line 419, in check
all_issues = checks.run_checks(
File "C:\Users\Someone\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\core\checks\registry.py", line 76, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File "C:\Users\Someone\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\core\checks\urls.py", line 13, in check_url_config
return check_resolver(resolver)
File "C:\Users\Someone\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\core\checks\urls.py", line 23, in check_resolver
return check_method()
File "C:\Users\Someone\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\urls\resolvers.py", line 416, in check
for pattern in self.url_patterns:
File "C:\Users\Someone\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\utils\functional.py", line 48, in get
res = instance.dict[self.name] = self.func(instance)
File "C:\Users\Someone\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\urls\resolvers.py", line 602, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "C:\Users\Someone\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\utils\functional.py", line 48, in get
res = instance.dict[self.name] = self.func(instance)
File "C:\Users\Someone\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\urls\resolvers.py", line 595, in urlconf_module
return import_module(self.urlconf_name)
File "C:\Users\Someone\AppData\Local\Programs\Python\Python38-32\lib\importlib_init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 783, in exec_module
File "", line 219, in call_with_frames_removed
File "C:\Users\Someone\Desktop\MyFairy\src\urls.py", line 14, in
path(r'socket/', include('sio_app.urls')),
File "C:\Users\Someone\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\urls\conf.py", line 34, in include
urlconf_module = import_module(urlconf_module)
File "C:\Users\Someone\AppData\Local\Programs\Python\Python38-32\lib\importlib_init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 783, in exec_module
File "", line 219, in _call_with_frames_removed
File "C:\Users\Someone\Desktop\MyFairy\sio_app\urls.py", line 2, in
from .views import index
File "C:\Users\Someone\Desktop\MyFairy\sio_app\views.py", line 14, in
sio = socketio.Server(async_mode='gevent', logger=True, engineio_logger=True, cors_allowed_origins="")
File "C:\Users\Someone\AppData\Local\Programs\Python\Python38-32\lib\site-packages\socketio\server.py", line 134, in init
self.eio = self._engineio_server_class()(**engineio_options)
File "C:\Users\Someone\AppData\Local\Programs\Python\Python38-32\lib\site-packages\engineio\server.py", line 150, in init
raise ValueError('Invalid async_mode specified')
ValueError: Invalid async_mode specified
Beta Was this translation helpful? Give feedback.
All reactions