python - 亚马逊 Elastic Beanstalk : how to set the wsgi path?

标签 python django amazon-web-services

我从那里的文档练习在 Elastic Beanstalk 下设置 Django。 但是有错误。

ERROR   Your WSGIPath refers to a file that does not exist.

我的目录是这样的:

-djangoenv (where I use git)
     - mysite 
          -manage.py
          -mysite 
              -__init__.py 
              -settings.py
              -urls.py
              -wsgi.py

我的 .elasticbeanstalk/optionsettings.djapp 文件是这样的:

enter image description here

还有.ebextensions/python.config这样的,不知道该放哪里,试了几次还是不行。我试了 mysite/mysite/wsgi.py 还是不行

container_commands:
  01_syncdb:    
    command: "django-admin.py syncdb --noinput"
    leader_only: true

option_settings:
  - namespace: aws:elasticbeanstalk:container:python
    option_name: WSGIPath
    value: mysite/wsgi.py
  - option_name: DJANGO_SETTINGS_MODULE
    value: mysite.settings

请告诉我如何以及在哪里设置我的 wsgi 路径??

非常感谢!

最佳答案

我发现您必须重新启动服务器才能将这些更改考虑在内。

我花了很长时间更改和调整这些选项,但没有任何效果。然后,当我转到 EB 控制台并重新启动环境时,它就可以正常工作了。

关于python - 亚马逊 Elastic Beanstalk : how to set the wsgi path?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26120642/

相关文章:

hadoop - Hadoop 2.6.4 Web UI超时

python - 没有 virtualenv 无法启动 uWSGI 服务器(ImportError)

python - 如何使用特定格式在 Django 模板上获取本地化日期?

python - 响应式 HTML 网站在较小的设备或屏幕上为标题生成 'black' 背景

python - 将 UTF-8 字节转换为 Python 中的其他编码

python - Django 中的异步文件写入功能是否需要 Celery?

python - 呈现 : 'int' object is not iterable in django template 时捕获类型错误

amazon-web-services - 将EMR日志发送到CloudWatch

amazon-web-services - AWS VPC 中的 CIDR block 重叠

python - 如果一个键存在多个值,如何在 python 字典中打印特定值的键?