我已经完成了一直在研究的Django项目,当我从PHP切换到Python时我害怕的那一天 - 部署。我总觉得它不容易部署并且让Django应用程序工作。我使用eb deploy
我的Django应用程序来进行弹性豆秆环境,但当我打开mysite.elasticbeanstalk.com
时,我得到索引/
mysite.config:
container_commands:
01_syncdb:
command: "django-admin.py syncdb --noinput"
leader_only: true
install_MySQL-python:
command: /opt/python27/run/venv/bin/easy_install MySQL-Python==1.2.4
option_settings:
- namespace: aws:elasticbeanstalk:container:python:staticfiles
option_name: WSGIPath
value: mysite/wsgi.py
- option_name: DJANGO_SETTINGS_MODULE
value: mysite.settings
- option_name: AWS_SECRET_KEY
value: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
- option_name: AWS_ACCESS_KEY_ID
value: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
我也试过了command: "manage.py syncdb --noinput"
,但它没有用。
文件夹结构:
.ebextensions/
mysite.config
.elasticbeanstalk/
config
manage.py
mysite/
__init__.py
settings.py
urls.py
wsgi.py
requirements.txt
当我查看错误日志时,这就是我得到的:
-------------------------------------
/opt/python/log/httpd.out
-------------------------------------
-------------------------------------
/var/log/httpd/error_log
-------------------------------------
[Mon Mar 09 12:38:02.208709 2015] [suexec:notice] [pid 6157] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Mar 09 12:38:02.259728 2015] [auth_digest:notice] [pid 6157] AH01757: generating secret for digest authentication ...
[Mon Mar 09 12:38:02.260895 2015] [lbmethod_heartbeat:notice] [pid 6157] AH02282: No slotmem from mod_heartmonitor
[Mon Mar 09 12:38:02.261027 2015] [:warn] [pid 6157] mod_wsgi: Compiled for Python/2.7.5.
[Mon Mar 09 12:38:02.261044 2015] [:warn] [pid 6157] mod_wsgi: Runtime using Python/2.7.8.
[Mon Mar 09 12:38:02.328774 2015] [mpm_prefork:notice] [pid 6157] AH00163: Apache/2.4.10 (Amazon) mod_wsgi/3.5 Python/2.7.8 configured -- resuming normal operations
[Mon Mar 09 12:38:02.328851 2015] [core:notice] [pid 6157] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
我不知道过去五天我做错了什么。