首页 > 解决方案 > 得到一个我真的不明白的 WSGI 错误

问题描述

每当我重新加载网页时,我都会在错误页面中收到此错误...

我将分享错误,然后分享 wsgi 文件。

错误:

2020-10-10 16:39:25 Sat Oct 10 16:39:25 2020 - received message 0 from emperor
2020-10-10 16:39:25 SIGINT/SIGQUIT received...killing workers...
2020-10-10 16:39:26 worker 1 buried after 1 seconds
2020-10-10 16:39:26 worker 2 buried after 1 seconds
2020-10-10 16:39:26 goodbye to uWSGI.
2020-10-10 16:39:26 chdir(): No such file or directory [core/uwsgi.c line 1610]
2020-10-10 16:39:26 VACUUM: unix socket /var/sockets/www.oriental-ghana.com/socket removed.
2020-10-10 16:39:40 *** Starting uWSGI 2.0.17.1 (64bit) on [Sat Oct 10 16:39:38 2020] ***
2020-10-10 16:39:40 compiled with version: 5.4.0 20160609 on 07 May 2020 19:40:56
2020-10-10 16:39:40 os: Linux-5.4.0-1020-aws #20-Ubuntu SMP Fri Jul 10 05:52:40 UTC 2020
2020-10-10 16:39:40 nodename: blue-liveweb6
2020-10-10 16:39:40 machine: x86_64
2020-10-10 16:39:40 clock source: unix
2020-10-10 16:39:40 pcre jit disabled
2020-10-10 16:39:40 detected number of CPU cores: 2
2020-10-10 16:39:40 current working directory: (unreachable)/etc/uwsgi/vassals
2020-10-10 16:39:40 detected binary path: /usr/local/bin/uwsgi
2020-10-10 16:39:40 *** dumping internal routing table ***
2020-10-10 16:39:40 [rule: 0] subject: path_info regexp: \.svgz$ action: addheader:Content-Encoding:gzip
2020-10-10 16:39:40 *** end of the internal routing table ***
2020-10-10 16:39:40 chdir() to /home/AliRedaM/
2020-10-10 16:39:40 limiting number of processes to 600...
2020-10-10 16:39:40 your processes number limit is 600
2020-10-10 16:39:40 your memory page size is 4096 bytes
2020-10-10 16:39:40 detected max file descriptor number: 123456
2020-10-10 16:39:40 building mime-types dictionary from file /etc/mime.types...
2020-10-10 16:39:40 552 entry found
2020-10-10 16:39:40 lock engine: pthread robust mutexes
2020-10-10 16:39:40 thunder lock: disabled (you can enable it with --thunder-lock)
2020-10-10 16:39:40 uwsgi socket 0 bound to UNIX address /var/sockets/www.oriental-ghana.com/socket fd 3
2020-10-10 16:39:40 Python version: 3.8.0 (default, Nov 14 2019, 22:29:45)  [GCC 5.4.0 20160609]
2020-10-10 16:39:40 Set PythonHome to /home/AliRedaM/.virtualenvs/Oriental
2020-10-10 16:39:40 *** Python threads support is disabled. You can enable it with --enable-threads ***
2020-10-10 16:39:40 Python main interpreter initialized at 0x1980590
2020-10-10 16:39:40 your server socket listen backlog is limited to 100 connections
2020-10-10 16:39:40 your mercy for graceful operations on workers is 60 seconds
2020-10-10 16:39:40 setting request body buffering size to 65536 bytes
2020-10-10 16:39:40 mapped 501384 bytes (489 KB) for 2 cores
2020-10-10 16:39:40 *** Operational MODE: preforking ***
2020-10-10 16:39:40 initialized 54 metrics
2020-10-10 16:39:40 WSGI app 0 (mountpoint='') ready in 1 seconds on interpreter 0x1980590 pid: 1 (default app)
2020-10-10 16:39:40 *** uWSGI is running in multiple interpreter mode ***
2020-10-10 16:39:40 gracefully (RE)spawned uWSGI master process (pid: 1)
2020-10-10 16:39:40 spawned uWSGI worker 1 (pid: 3, cores: 1)
2020-10-10 16:39:40 spawned 2 offload threads for uWSGI worker 1
2020-10-10 16:39:40 spawned uWSGI worker 2 (pid: 6, cores: 1)
2020-10-10 16:39:40 metrics collector thread started
2020-10-10 16:39:40 spawned 2 offload threads for uWSGI worker 2

我的 wsgi 文件:

         +++++++++++ DJANGO +++++++++++
    To use your own django app use code like this:
    import os
    import sys

     assuming your Django settings file is at '/home/myusername/mysite/mysite/settings.py'
    path = '/home/AliRedaM/res'
    if path not in sys.path:
        sys.path.insert(0, path)

    os.chdir(path)
    os.environ['DJANGO_SETTINGS_MODULE'] = 'project.settings'

    import django
    django.setup()
     Uncomment the lines below depending on your Django version
     then, for Django >=1.5:
    from django.core.wsgi import get_wsgi_application
    application = get_wsgi_application()

标签: pythonanywhere

解决方案


推荐阅读