我不赞成使用django-channels框架。我在运行asgi服务器时遇到问题。如果有人可以帮助解决这些问题,我将不胜感激。我收到警告的错误是:
(base) C:\Users\praks\Desktop\django_web_page\mysite>python manage.py runserver
:0: UserWarning: You do not have a working installation of the service_identity module: 'No module named 'service_identity''. Please install it from <https://pypi.python.org/pypi/service_identity> and make sure all of its dependencies are satisfied. Without the service_identity module, Twisted can perform only rudimentary TLS client hostname verification. Many valid certificate/hostname mappings may be rejected.
:0: UserWarning: You do not have a working installation of the service_identity module: 'No module named 'service_identity''. Please install it from <https://pypi.python.org/pypi/service_identity> and make sure all of its dependencies are satisfied. Without the service_identity module, Twisted can perform only rudimentary TLS client hostname verification. Many valid certificate/hostname mappings may be rejected.
Performing system checks...
System check identified no issues (0 silenced).
October 06, 2018 - 12:18:38
Django version 2.0.7, using settings 'mysite.settings'
Starting ASGI/Channels version 2.1.2 development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x000002AE7AF74488>
Traceback (most recent call last):
File "C:\Users\praks\Anaconda3\lib\site-packages\channels\routing.py", line 33, in get_default_application
module = importlib.import_module(path)
File "C:\Users\praks\Anaconda3\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 941, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'mysite.mysite'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\praks\Anaconda3\lib\site-packages\django\utils\autoreload.py", line 225, in wrapper
fn(*args, **kwargs)
File "C:\Users\praks\Anaconda3\lib\site-packages\channels\management\commands\runserver.py", line 80, in inner_run
application=self.get_application(options),
File "C:\Users\praks\Anaconda3\lib\site-packages\channels\management\commands\runserver.py", line 105, in get_application
return StaticFilesWrapper(get_default_application())
File "C:\Users\praks\Anaconda3\lib\site-packages\channels\routing.py", line 35, in get_default_application
raise ImproperlyConfigured("Cannot import ASGI_APPLICATION module %r" % path)
django.core.exceptions.ImproperlyConfigured: Cannot import ASGI_APPLICATION module 'mysite.mysite.routing'