我正在IIS中部署Django应用。我已经通过这个链接 https://www.mattwoodward.com/2016/07/23/running-a-django-application-on-windows-server-2012-with-iis/,然后逐步进行操作。但是当我托管名为“ sample”的Django应用程序时,IIS上托管的其他应用程序在浏览时开始显示以下错误,并且提到其他应用程序是在不同的框架中开发的。
Error occurred while reading WSGI handler:
Traceback (most recent call last):
File "C:\virtualenvs\sample\Lib\site-packages\wfastcgi.py", line 791, in main
env, handler = read_wsgi_handler(response.physical_path)
File "C:\virtualenvs\sample\Lib\site-packages\wfastcgi.py", line 633, in read_wsgi_handler
handler = get_wsgi_handler(os.getenv("WSGI_HANDLER"))
File "C:\virtualenvs\sample\Lib\site-packages\wfastcgi.py", line 616, in get_wsgi_handler
raise ValueError('"%s" could not be imported%s' % (handler_name, last_tb))
ValueError: "django.core.wsgi.get_wsgi_application()" could not be imported: Traceback (most recent call last):
File "C:\virtualenvs\sample\Lib\site-packages\wfastcgi.py", line 605, in get_wsgi_handler
handler = handler()
File "C:\virtualenvs\sample\lib\site-packages\django\core\wsgi.py", line 12, in get_wsgi_application
django.setup(set_prefix=False)
File "C:\virtualenvs\sample\lib\site-packages\django\__init__.py", line 19, in setup
configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
File "C:\virtualenvs\sample\lib\site-packages\django\conf\__init__.py", line 57, in __getattr__
self._setup(name)
File "C:\virtualenvs\sample\lib\site-packages\django\conf\__init__.py", line 44, in _setup
self._wrapped = Settings(settings_module)
File "C:\virtualenvs\sample\lib\site-packages\django\conf\__init__.py", line 107, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "C:\Python37-32\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'sample'
当我浏览我的应用程序“示例”时,它也显示相同的错误。 我在堆栈中搜索以解决此错误,但无法弄清楚。请帮助我解决此错误。