尝试使用uwsgi运行Django项目时出现内部服务器错误

时间:2019-06-18 19:25:46

标签: python django uwsgi internal-server-error

我正在尝试使用nginx + uwsgi在我的centos中部署django应用程序 我创建了一个新的django应用程序,并设置了相关的ini文件以及启动和运行此新项目所需的一切,但是当我尝试使用uwsgi使我的主要django应用程序运行时,出现以下错误:

    File "/opt/python-virtual-env/demo/lib64/python3.6/site-packages/django/apps/config.py", line 107, in create
    entry = module.default_app_config
AttributeError: module 'ed' has no attribute 'default_app_config'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./restapi/wsgi.py", line 16, in <module>
    application = get_wsgi_application()
  File "/opt/python-virtual-env/demo/lib64/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
    django.setup(set_prefix=False)
  File "/opt/python-virtual-env/demo/lib64/python3.6/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/opt/python-virtual-env/demo/lib64/python3.6/site-packages/django/apps/registry.py", line 89, in populate
    app_config = AppConfig.create(entry)
  File "/opt/python-virtual-env/demo/lib64/python3.6/site-packages/django/apps/config.py", line 110, in create
    return cls(entry, module)
  File "/opt/python-virtual-env/demo/lib64/python3.6/site-packages/django/apps/config.py", line 40, in __init__
    self.path = self._path_from_module(app_module)
  File "/opt/python-virtual-env/demo/lib64/python3.6/site-packages/django/apps/config.py", line 73, in _path_from_module
    "with a 'path' class attribute." % (module, paths))
django.core.exceptions.ImproperlyConfigured: The app module <module 'ed' (namespace)> has multiple filesystem locations (['/srv/www/restapi/ed', './ed']); you must configure this app with an AppConfig subclass with a 'path' class attribute.
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) *** 
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 9642, cores: 1)

我猜想这与我的“ ed”模块有关,但我不知道如何解决。 (我没有写代码,所以我不知道到底发生了什么,我只是想在此服务器上部署应用程序)

0 个答案:

没有答案