Ron*_*ior 7 amazon-web-services python-requests amazon-elastic-beanstalk
我正在 AWS Elastic Beanstalk 环境中工作,并且收到以下消息:
[Mon May 13 12:38:41.784799 2019] [:error] [pid 3841]
ModuleNotFoundError: No module named 'requests'
Run Code Online (Sandbox Code Playgroud)
该消息非常明显,我已将该模块添加到我的 requirements.txt 并且在我的机器上一切正常,但它在 AWS 环境中不起作用。
我只是想知道是否有任何技巧可以将模块导入 AWS。
要求.txt
certifi==2019.3.9
chardet==3.0.4
Django==2.1.7
django-cors-headers==2.5.2
django-extensions==2.1.6
django-filter==2.1.0
djangorestframework==3.9.2
idna==2.8
mysqlclient==1.4.2.post1
python-dateutil==2.8.0
pytz==2018.9
requests==2.21.0
six==1.12.0
text-unidecode==1.2
urllib3==1.24.3
Run Code Online (Sandbox Code Playgroud)
.ebextensions/django.config
option_settings:
aws:elasticbeanstalk:container:python:
WSGIPath: entrypoint/wsgi.py
container_commands:
01_wsgipass:
command: 'echo "WSGIPassAuthorization On" >> ../wsgi.conf'
Run Code Online (Sandbox Code Playgroud)
.elasticbeanstalk/config.yml
branch-defaults:
master:
environment: XXXXX
group_suffix: null
environment-defaults:
squirrel-api-env:
branch: null
repository: null
global:
application_name: XXXXX
branch: null
default_ec2_keyname: api-key
default_platform: python-3.6
default_region: ap-southeast-2
include_git_submodules: true
instance_profile: null
platform_name: null
platform_version: null
profile: eb-cli
repository: null
sc: git
workspace_type: Application
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1294 次 |
| 最近记录: |