Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Django应用程序未在Elastic Beanstalk AWS上启动_Python_Django_Python 3.x_Amazon Web Services_Amazon Elastic Beanstalk - Fatal编程技术网

Python Django应用程序未在Elastic Beanstalk AWS上启动

Python Django应用程序未在Elastic Beanstalk AWS上启动,python,django,python-3.x,amazon-web-services,amazon-elastic-beanstalk,Python,Django,Python 3.x,Amazon Web Services,Amazon Elastic Beanstalk,当我在elastic beanstalk上部署Django项目时,我得到一个500内部服务器错误。我已经尝试了所有的方法,电子商务仪表板看起来很好,健康状况很好,没有提到任何错误。有人能解释一下吗 ============= i-03980c0f6a1094e3c ============== ------------------------------------- /var/log/httpd/error_log ------------------------------------- [

当我在elastic beanstalk上部署Django项目时,我得到一个500内部服务器错误。我已经尝试了所有的方法,电子商务仪表板看起来很好,健康状况很好,没有提到任何错误。有人能解释一下吗

============= i-03980c0f6a1094e3c ==============
-------------------------------------
/var/log/httpd/error_log
-------------------------------------
[Wed Apr 04 13:15:51.669498 2018] [suexec:notice] [pid 3065] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Wed Apr 04 13:15:51.684578 2018] [http2:warn] [pid 3065] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more demands in this regard and the 
currently selected mpm will just not do. This is an advisory warning. Your server will continue to work, but the HTTP/2 protocol will be inactive.
[Wed Apr 04 13:15:51.684588 2018] [http2:warn] [pid 3065] AH02951: mod_ssl does not seem to be enabled
[Wed Apr 04 13:15:51.685042 2018] [lbmethod_heartbeat:notice] [pid 3065] AH02282: No slotmem from mod_heartmonitor
[Wed Apr 04 13:15:51.686951 2018] [mpm_prefork:notice] [pid 3065] AH00163: Apache/2.4.27 (Amazon) mod_wsgi/3.5 Python/3.6.2 configured -- resuming normal operations
[Wed Apr 04 13:15:51.686971 2018] [core:notice] [pid 3065] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Wed Apr 04 13:16:13.037691 2018] [mpm_prefork:notice] [pid 3065] AH00169: caught SIGTERM, shutting down
[Wed Apr 04 13:16:14.092208 2018] [suexec:notice] [pid 3287] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Wed Apr 04 13:16:14.107856 2018] [so:warn] [pid 3287] AH01574: module wsgi_module is already loaded, skipping
[Wed Apr 04 13:16:14.110001 2018] [http2:warn] [pid 3287] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more demands in this regard and the 
currently selected mpm will just not do. This is an advisory warning. Your server will continue to work, but the HTTP/2 protocol will be inactive.
[Wed Apr 04 13:16:14.110011 2018] [http2:warn] [pid 3287] AH02951: mod_ssl does not seem to be enabled
[Wed Apr 04 13:16:14.110578 2018] [lbmethod_heartbeat:notice] [pid 3287] AH02282: No slotmem from mod_heartmonitor
[Wed Apr 04 13:16:14.113943 2018] [mpm_prefork:notice] [pid 3287] AH00163: Apache/2.4.27 (Amazon) mod_wsgi/3.5 Python/3.6.2 configured -- resuming normal operations
[Wed Apr 04 13:16:14.113964 2018] [core:notice] [pid 3287] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Wed Apr 04 13:16:14.142312 2018] [:error] [pid 3292] mod_wsgi (pid=3292): Call to 'site.addsitedir()' failed for '(null)', stopping.
[Wed Apr 04 13:16:14.142341 2018] [:error] [pid 3292] mod_wsgi (pid=3292): Call to 'site.addsitedir()' failed for '/opt/python/run/venv/lib64/python3.6/site-packages:/opt/python/run/venv/lib/python3.6/site-packages'.
[Wed Apr 04 13:16:16.869762 2018] [:error] [pid 3292] mod_wsgi (pid=3292): Call to 'site.addsitedir()' failed for '(null)', stopping.
[Wed Apr 04 13:16:16.869800 2018] [:error] [pid 3292] mod_wsgi (pid=3292): Call to 'site.addsitedir()' failed for '/opt/python/run/venv/lib64/python3.6/site-packages:/opt/python/run/venv/lib/python3.6/site-packages'.
[Wed Apr 04 13:16:16.870482 2018] [:error] [pid 3292] [remote 127.0.0.1:252] mod_wsgi (pid=3292): Target WSGI script '/opt/python/current/app/testapi/wsgi.py' cannot be loaded as Python module.
[Wed Apr 04 13:16:16.870510 2018] [:error] [pid 3292] [remote 127.0.0.1:252] mod_wsgi (pid=3292): Exception occurred processing WSGI script '/opt/python/current/app/testapi/wsgi.py'.
[Wed Apr 04 13:16:16.870676 2018] [:error] [pid 3292] [remote 127.0.0.1:252] Traceback (most recent call last):
[Wed Apr 04 13:16:16.870699 2018] [:error] [pid 3292] [remote 127.0.0.1:252]   File "/opt/python/current/app/testapi/wsgi.py", line 12, in <module>
[Wed Apr 04 13:16:16.870702 2018] [:error] [pid 3292] [remote 127.0.0.1:252]     from django.core.wsgi import get_wsgi_application
[Wed Apr 04 13:16:16.870716 2018] [:error] [pid 3292] [remote 127.0.0.1:252] ModuleNotFoundError: No module named 'django'
[Wed Apr 04 13:16:17.873718 2018] [:error] [pid 3292] [remote 127.0.0.1:248] mod_wsgi (pid=3292): Target WSGI script '/opt/python/current/app/testapi/wsgi.py' cannot be loaded as Python module.
[Wed Apr 04 13:16:17.873768 2018] [:error] [pid 3292] [remote 127.0.0.1:248] mod_wsgi (pid=3292): Exception occurred processing WSGI script '/opt/python/current/app/testapi/wsgi.py'.
[Wed Apr 04 13:16:17.873855 2018] [:error] [pid 3292] [remote 127.0.0.1:248] Traceback (most recent call last):
[Wed Apr 04 13:16:17.873881 2018] [:error] [pid 3292] [remote 127.0.0.1:248]   File "/opt/python/current/app/testapi/wsgi.py", line 12, in <module>
[Wed Apr 04 13:16:17.873885 2018] [:error] [pid 3292] [remote 127.0.0.1:248]     from django.core.wsgi import get_wsgi_application
[Wed Apr 04 13:16:17.873899 2018] [:error] [pid 3292] [remote 127.0.0.1:248] ModuleNotFoundError: No module named 'django'
[Wed Apr 04 13:16:18.876808 2018] [:error] [pid 3292] [remote 127.0.0.1:2556] mod_wsgi (pid=3292): Target WSGI script '/opt/python/current/app/testapi/wsgi.py' cannot be loaded as Python module.
[Wed Apr 04 13:16:18.876857 2018] [:error] [pid 3292] [remote 127.0.0.1:2556] mod_wsgi (pid=3292): Exception occurred processing WSGI script '/opt/python/current/app/testapi/wsgi.py'.
[Wed Apr 04 13:16:18.876927 2018] [:error] [pid 3292] [remote 127.0.0.1:2556] Traceback (most recent call last):
================i-03980c0f6a1094e3c==============
-------------------------------------
/var/log/httpd/error\u log
-------------------------------------
[Wed Apr 04 13:15:51.669498 2018][suexec:notice][pid 3065]AH01232:suexec机制已启用(包装器:/usr/sbin/suexec)
[Wed Apr 04 13:15:51.684578 2018][http2:warn][pid 3065]AH10034:mod_http2不支持mpm模块(prefork.c)。mpm决定如何在服务器中处理内容。HTTP/2在这方面有更多的要求,并且
当前选择的mpm将不起作用。这是一个警告。您的服务器将继续工作,但HTTP/2协议将处于非活动状态。
[Wed Apr 04 13:15:51.684588 2018][http2:warn][pid 3065]AH02951:mod_ssl似乎未启用
[Wed Apr 04 13:15:51.685042 2018][lbmethod_heartbeat:notice][pid 3065]AH02282:mod_heartmonitor没有slotmem
[Wed Apr 04 13:15:51.686951 2018][mpm_prefork:notice][pid 3065]AH00163:Apache/2.4.27(Amazon)mod_wsgi/3.5 Python/3.6.2已配置--恢复正常操作
[Wed Apr 04 13:15:51.686971 2018][core:notice][pid 3065]AH00094:命令行:'/usr/sbin/httpd-D FOREGROUND'
[Wed Apr 04 13:16:13.037691 2018][mpm_prefork:notice][pid 3065]AH00169:已捕获信号,正在关闭
[Wed Apr 04 13:16:14.092208 2018][suexec:notice][pid 3287]AH01232:suexec机制已启用(包装器:/usr/sbin/suexec)
[Wed Apr 04 13:16:14.107856 2018][so:warn][pid 3287]AH01574:模块wsgi_模块已加载,正在跳过
[Wed Apr 04 13:16:14.110001 2018][http2:warn][pid 3287]AH10034:mod_http2不支持mpm模块(prefork.c)。mpm决定如何在服务器中处理内容。HTTP/2在这方面有更多的要求,并且
当前选择的mpm将不起作用。这是一个警告。您的服务器将继续工作,但HTTP/2协议将处于非活动状态。
[Wed Apr 04 13:16:14.110011 2018][http2:warn][pid 3287]AH02951:mod_ssl似乎未启用
[Wed Apr 04 13:16:14.110578 2018][lbmethod_heartbeat:notice][pid 3287]AH02282:mod_heartmonitor没有slotmem
[Wed Apr 04 13:16:14.113943 2018][mpm_prefork:notice][pid 3287]AH00163:Apache/2.4.27(Amazon)mod_wsgi/3.5 Python/3.6.2已配置--恢复正常操作
[Wed Apr 04 13:16:14.113964 2018][core:notice][pid 3287]AH00094:命令行:'/usr/sbin/httpd-D FOREGROUND'
[Wed Apr 04 13:16:14.142312 2018][:error][pid 3292]mod_wsgi(pid=3292):调用'site.addsitedir()'失败,原因是'(null'),正在停止。
[Wed Apr 04 13:16:14.142341 2018][:error][pid 3292]mod_wsgi(pid=3292):对“/opt/python/run/venv/lib64/python3.6/site包:/opt/python/run/venv/lib/python3.6/site包”调用“site.addsitedir()”失败。
[Wed Apr 04 13:16:16.869762 2018][:error][pid 3292]mod_wsgi(pid=3292):调用'site.addsitedir()'失败,原因是'(null'),正在停止。
[Wed Apr 04 13:16:16.869800 2018][:error][pid 3292]mod_wsgi(pid=3292):对“/opt/python/run/venv/lib64/python3.6/site包:/opt/python/run/venv/lib/python3.6/site包”调用“site.addsitedir()”失败。
[Wed Apr 04 13:16:16.870482 2018][:error][pid 3292][remote 127.0.0.1:252]mod_wsgi(pid=3292):无法将目标wsgi脚本“/opt/python/current/app/testapi/wsgi.py”作为python模块加载。
[Wed Apr 04 13:16:16.870510 2018][:error][pid 3292][remote 127.0.0.1:252]mod_wsgi(pid=3292):处理wsgi脚本'/opt/python/current/app/testapi/wsgi.py'时发生异常。
[Wed Apr 04 13:16:16.870676 2018][:error][pid 3292][remote 127.0.0.1:252]回溯(最近一次呼叫最后一次):
[Wed Apr 04 13:16:16.870699 2018][:error][pid 3292][remote 127.0.0.1:252]文件“/opt/python/current/app/testapi/wsgi.py”,第12行,在
[Wed Apr 04 13:16:16.870702 2018][:error][pid 3292][remote 127.0.0.1:252]来自django.core.wsgi导入获取wsgi应用程序
[Wed Apr 04 13:16:16.870716 2018][:error][pid 3292][remote 127.0.0.1:252]ModuleNotFoundError:没有名为“django”的模块
[Wed Apr 04 13:16:17.873718 2018][:error][pid 3292][remote 127.0.0.1:248]mod_wsgi(pid=3292):无法将目标wsgi脚本“/opt/python/current/app/testapi/wsgi.py”作为python模块加载。
[Wed Apr 04 13:16:17.873768 2018][:error][pid 3292][remote 127.0.0.1:248]mod_wsgi(pid=3292):处理wsgi脚本'/opt/python/current/app/testapi/wsgi.py'时发生异常。
[Wed Apr 04 13:16:17.873855 2018][:error][pid 3292][remote 127.0.0.1:248]回溯(最近一次呼叫最后一次):
[Wed Apr 04 13:16:17.873881 2018][:error][pid 3292][remote 127.0.0.1:248]文件“/opt/python/current/app/testapi/wsgi.py”,第12行,在
[Wed Apr 04 13:16:17.873885 2018][:error][pid 3292][remote 127.0.0.1:248]来自django.core.wsgi导入get_wsgi_应用程序
[Wed Apr 04 13:16:17.873899 2018][:error][pid 3292][remote 127.0.0.1:248]ModuleNotFoundError:没有名为“django”的模块
[Wed Apr 04 13:16:18.876808 2018][:error][pid 3292][remote 127.0.0.1:2556]mod_wsgi(pid=3292):无法将目标wsgi脚本“/opt/python/current/app/testapi/wsgi.py”作为python模块加载。
[Wed Apr 04 13:16:18.876857 2018][:error][pid 3292][remote 127.0.0.1:2556]mod_wsgi(pid=3292):处理wsgi脚本'/opt/python/current/app/testapi/wsgi.py'时发生异常。
[Wed Apr 04 13:16:18.876927 2018][:error][pid 3292][remote 127.0.0.1:2556]回溯(最近一次呼叫最后一次):

在项目目录中,您应该有一个
.elasticbeanstalk
文件夹,您必须有另一个
.ebextensions
。如果没有,请添加它

然后,您必须创建文件,以便在EBT将为您触发的实例上运行
一些东西。例如,添加一个文件,如
10_packages.config
# 10_packages.config
# Add the packages needed to run the application and some other tools
packages:
    yum:
        git: []
        postgresql94-devel: []
        gcc: []
        gcc-c++: []
        make: []
        libffi-devel: []
        libmemcached-devel: []
        vim-enhanced: []
# 20_pip_requirements.config
# Update pip in the venv
commands:
  01_upgrade_pip_for_venv:
    command: "sudo /opt/python/run/venv/bin/pip install --upgrade pip"
# 30_migrate.config
container_commands:
  01_migrate_database:
        command: "./manage.py migrate"
        leader_only: true