You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Django启动runserver报ImproperlyConfigured:无法加载WSGI应用

Django启动runserver时WSGI应用加载失败问题

执行python manage.py check无任何报错,但启动服务python manage.py runserver时出现如下错误:

File "C:\Users\oliver\apollodev\django-apollo-forms\venv\lib\site-packages\django\core\servers\basehttp.py", line 50, in get_internal_wsgi_application
    raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: WSGI application 'apollo.wsgi.application' could not be loaded; Error importing module.

报错对应的代码段(已自行添加print调试):

try:
    print("/////////////////////////basehttp.py app_path = ", app_path )
    return import_string(app_path)
except ImportError as err:
    raise ImproperlyConfigured(
        "WSGI application '%s' could not be loaded; "
        "Error importing module." % app_path
    ) from err

添加print语句后的启动输出:

Quit the server with CTRL-BREAK.
/////////////////////////basehttp.py app_path =  apollo.wsgi.application
Exception in thread django-main-thread:
Traceback (most recent call last):
  File "C:\Users\oliver\apollodev\django-apollo-forms\venv\lib\site-packages\django\core\servers\basehttp.py", line 48, in get_internal_wsgi_application
    return import_string(app_path)

当前配置:settings.py中已设置WSGI_APPLICATION = 'apollo.wsgi.application',尝试将apollo.wsgi加入INSTALLED_APPS后出现新错误:

File "C:\Users\oliver\apollodev\django-apollo-forms\venv\lib\site-packages\django\apps\registry.py", line 83, in populate
    raise RuntimeError("populate() isn't reentrant")

目前无法确定下一步排查方向,寻求解决方案。


内容的提问来源于stack exchange,提问作者Mike Oliver

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.20 03:45:39