gpt4 book ai didi

python - Openshift-django-mysql : No tables created to database via syncdb

转载 作者:行者123 更新时间:2023-11-29 13:49:10 27 4
gpt4 key购买 nike

我的设置.py

if ON_OPENSHIFT:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'django',
'USER': 'USER',
'PASSWORD': 'PASS',
'HOST': '127.2.202.129',
'PORT': '3306',
}
}

和我的action_hooks/deploy

source $OPENSHIFT_APP_DIR/virtenv/bin/activate
export PYTHON_EGG_CACHE=$OPENSHIFT_APP_DIR/virtenv/lib/python-2.6

echo "Executing 'python $OPENSHIFT_REPO_DIR/wsgi/my/manage.py syncdb --noinput'"
python $OPENSHIFT_REPO_DIR/wsgi/my/manage.py syncdb --noinput

echo "Executing 'python $OPENSHIFT_REPO_DIR/wsgi/my/manage.py collectstatic --noinput'"
python $OPENSHIFT_REPO_DIR/wsgi/my/manage.py collectstatic --noinput

每当我这样做时,

git add .
git commit -a -m "project"
git push

我的数据库没有显示表...为什么?
提前致谢

最佳答案

阅读本文,您将更多地了解 OpenShift 上的 Django

http://appsembler.com/blog/django-deployment-using-openshift/

关于python - Openshift-django-mysql : No tables created to database via syncdb,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16947252/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com