django ウェブアプリを AWS EB にデプロイするのに助けが必要です。私のローカル開発環境は mac os maverick です。私はdjango 1.6とvirtualenv 1.11.4を使用しています。AWS の手順を使用してデプロイできた場合は、その経験と、障害を克服するために別の方法で行ったことを共有していただければ幸いです。
[django aws] ( http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_Python_django.html )
ステップ 6: アプリケーションの更新で行き詰まっています。
いくつかの構成ファイルを試しましたが、どれも機能しませんでした:
dgeneric.config:
container_commands:
01_syncdb:
command: "django-admin.py syncdb --noinput"
leader_only: true
option_settings:
- namespace: aws:elasticbeanstalk:container:python
option_name: WSGIPath
value: django_generic/wsgi.py
- option_name: DJANGO_SETTINGS_MODULE
value: django_generic.settings
- option_name: AWS_SECRET_KEY
value: SAMPLESECRETxMkk7DTME37PgiEnzA8toans
- option_name: AWS_ACCESS_KEY_ID
value: SAMPLEACCESSDAHRD7A
dgeneric.config バージョン 2:
container_commands:
collectstatic:
command: "django-admin.py collectstatic --noinput"
01syncdb:
command: "django-admin.py syncdb --noinput"
leader_only: true
02migrate:
command: "django-admin.py migrate"
leader_only: true
99customize:
command: "scripts/customize.sh"
You can specify any key-value pairs in the aws:elasticbeanstalk:application:environment namespace and it will be
passed in as environment variables on your EC2 instances
option_settings:
"aws:elasticbeanstalk:application:environment":
DJANGO_SETTINGS_MODULE: "django_generic.settings"
"application_stage": "staging"
"aws:elasticbeanstalk:container:python":
WSGIPath: django_generic/wsgi.py
NumProcesses: 3
NumThreads: 20
"aws:elasticbeanstalk:container:python:staticfiles":
"/static/": "static/"
dgeneric.config バージョン 3:
container_commands:
00_make_executable:
command: "chmod +x scripts/createadmin.py"
leader_only: true
01_syncdb:
command: "django-admin.py syncdb --noinput"
leader_only: true
02_createadmin:
command: "scripts/createadmin.py"
leader_only: true
03_collectstatic:
command: "django-admin.py collectstatic --noinput"
option_settings:
"aws:elasticbeanstalk:container:python:environment":
DJANGO_SETTINGS_MODULE: "django_generic.settings"
"aws:elasticbeanstalk:container:python":
WSGIPath: "django_generic/wsgi.py"
"aws:elasticbeanstalk:container:python:staticfiles":
"/static/": "static/"
私が受け取ったエラーは次のとおりです。
2014-03-19 16:30:09 UTC-0400 INFO Environment update completed successfully.
2014-03-19 16:30:09 UTC-0400 INFO New application version was deployed to running EC2 instances.
2014-03-19 16:30:08 UTC-0400 INFO Command execution completed. Summary: [Successful: 0, Failed: 1].
2014-03-19 16:30:08 UTC-0400 ERROR [Instance: i-3311f412 Module: AWSEBAutoScalingGroup ConfigSet: null] Command failed on instance. Return code: 1 Output: Error occurred during build: Command 02_createadmin failed .
2014-03-19 16:28:59 UTC-0400 INFO Deploying new version to instance(s).
また、構成ファイルにわずかな変更を加えた別の試行からのエラーの別のスニペットを次に示します。
2014-03-19 16:02:57 UTC-0400 INFO Environment update completed successfully.
2014-03-19 16:02:57 UTC-0400 INFO New application version was deployed to running EC2 instances.
2014-03-19 16:02:56 UTC-0400 INFO Command execution completed. Summary: [Successful: 0, Failed: 1].
2014-03-19 16:02:56 UTC-0400 ERROR [Instance: i-3311f412 Module: AWSEBAutoScalingGroup ConfigSet: null] Command failed on instance. Return code: 1 Output: Error occurred during build: Command 01_syncdb failed .
2014-03-19 16:02:49 UTC-0400 INFO Deploying new version to instance(s).
2014-03-19 16:01:52 UTC-0400 INFO Environment update is starting.
基本的に、これらのエラーは構成ファイルが正しく構成されていないことが原因です。あなたのサクセス ストーリーや、展開のこのステップをどのようにパスしたかを教えていただけますか? 私が見ているように、次のAmazon docsは機能しません。ところで、次の例も試しましたが、うまくいかなかったようです。 http://grigory.ca/2012/09/getting-started-with-django-on-aws-elastic-beanstalk/
本当にありがとうございました。