我正在尝试使用IIS Server生产Django Web应用程序,但出现此错误:
读取WSGI处理程序时发生错误:
Traceback (most recent call last):
File "c:\programdata\anaconda3\lib\site-packages\wfastcgi.py", line 791, in main
env, handler = read_wsgi_handler(response.physical_path)
File "c:\programdata\anaconda3\lib\site-packages\wfastcgi.py", line 633, in read_wsgi_handler
handler = get_wsgi_handler(os.getenv("WSGI_HANDLER"))
File "c:\programdata\anaconda3\lib\site-packages\wfastcgi.py", line 616, in get_wsgi_handler
raise ValueError('"%s" could not be imported%s' % (handler_name, last_tb))
ValueError: "SGC.wsgi.application" could not be imported: Traceback (most recent call last):
File "c:\programdata\anaconda3\lib\site-packages\wfastcgi.py", line 600, in get_wsgi_handler
handler = __import__(module_name, fromlist=[name_list[0][0]])
File ".\SGC\wsgi.py", line 16, in <module>
application = get_wsgi_application()
File "c:\programdata\anaconda3\lib\site-packages\django\core\wsgi.py", line 12, in get_wsgi_application
django.setup(set_prefix=False)
File "c:\programdata\anaconda3\lib\site-packages\django\__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "c:\programdata\anaconda3\lib\site-packages\django\apps\registry.py", line 92, in populate
app_config = AppConfig.create(entry)
File "c:\programdata\anaconda3\lib\site-packages\django\apps\config.py", line 90, in create
module = import_module(entry)
File "c:\programdata\anaconda3\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named 'ckeditor'
StdOut:
StdErr:
在我的应用程序中,安装了有关债权人的所有内容。
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'hr.apps.HrConfig',
'account',
'courriers',
'rolepermissions',
'crispy_forms',
'admin_tools',
'cart.apps.CartConfig',
'enregistrement',
'ckeditor',
'debug_toolbar',
]
Here is my web.config file:
<system.webServer>
<handlers>
<add name="SCG SERVER"
path="*"
verb="*"
modules="FastCgiModule"
scriptProcessor="c:\programdata\anaconda3\python.exe|c:\programdata\anaconda3\lib\site-packages\wfastcgi.py"
resourceType="Unspecified"
requireAccess="Script" />
</handlers>
</system.webServer>
<appSettings>
<add key="PYTHONPATH" value="F:\SGC" />
<add key="WSGI_HANDLER" value="SGC.wsgi.application" />
<add key="DJANGO_SETTINGS_MODULE" value="SGC.settings" />
</appSettings>
</configuration>
对我来说,我认为该错误与以下行有关:'raise ValueError('“%s”无法导入%s'%(handler_name,last_tb))。 请帮助我。