我正在尝试使用 Django non-rel 让 Django 在 Google App Engine 上运行。我正在关注Django 1.5 教程但是,当我运行时:
python manage.py sql polls
什么都没有返回。谁能建议为什么“manage.py sql”会默默地失败?
当我同步数据库时,我得到:
$ python manage.py syncdb
Creating tables ...
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)
数据库在settings.py中指定如下:
# Activate django-dbindexer for the default database
DATABASES['default'] = {'ENGINE': 'dbindexer', 'TARGET': DATABASES['default']}
AUTOLOAD_SITECONF = 'indexes'
我记得在 settings.py 中包含“民意调查”
INSTALLED_APPS = (
# 'django.contrib.admin',
'django.contrib.contenttypes',
'django.contrib.auth',
'django.contrib.sessions',
'djangotoolbox',
'autoload',
'dbindexer',
'polls',
# djangoappengine should come last, so it can override a few manage.py commands
'djangoappengine',
)
并且模型存在于 polls/models.py
from django.db import models
class Poll(models.Model):
question = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
class Choice(models.Model):
poll = models.ForeignKey(Poll)
choice_text = models.CharField(max_length=200)
votes = models.IntegerField(default=0)
注意:如果我将 settings.py 更改为使用本地 sqlite3 数据库,则“manage.py sql polls”的行为如教程中所述。因此,据我所知,这与以下内容无关:
- /polls 目录结构
- /polls/models.py 文件
- 蟒蛇路径