gpt4 book ai didi

django - South + Django 1.4 数据库错误

转载 作者:行者123 更新时间:2023-12-03 10:33:07 25 4
gpt4 key购买 nike

我刚刚在新系统上安装了我的 Django 项目,并安装了 Django 1.4。但是,当我尝试运行 manage.py runserver 时或 manage.py syncdb我从南方收到这个错误:

Validating models...

Unhandled exception in thread started by <bound method Command.inner_run of <django.contrib.staticfiles.management.commands.runserver.Command object at 0x1a67810>>
Traceback (most recent call last):
File "/home/saul/.virtualenvs/canada/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 91, in inner_run
self.validate(display_num_errors=True)
File "/home/saul/.virtualenvs/canada/lib/python2.7/site-packages/django/core/management/base.py", line 266, in validate
num_errors = get_validation_errors(s, app)
File "/home/saul/.virtualenvs/canada/lib/python2.7/site-packages/django/core/management/validation.py", line 30, in get_validation_errors
for (app_name, error) in get_app_errors().items():
File "/home/saul/.virtualenvs/canada/lib/python2.7/site-packages/django/db/models/loading.py", line 158, in get_app_errors
self._populate()
File "/home/saul/.virtualenvs/canada/lib/python2.7/site-packages/django/db/models/loading.py", line 64, in _populate
self.load_app(app_name, True)
File "/home/saul/.virtualenvs/canada/lib/python2.7/site-packages/django/db/models/loading.py", line 88, in load_app
models = import_module('.models', app_name)
File "/home/saul/.virtualenvs/canada/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/home/saul/.virtualenvs/canada/lib/python2.7/site-packages/south/models.py", line 2, in <module>
from south.db import DEFAULT_DB_ALIAS
File "/home/saul/.virtualenvs/canada/lib/python2.7/site-packages/south/db/__init__.py", line 78, in <module>
db = dbs[DEFAULT_DB_ALIAS]
KeyError: 'default'

我目前正在使用 SQLite。我想可能是因为这个 change使用 Django 1.4,但其他用户似乎没有我的问题。我所有的包裹都是最新的。

最佳答案

您没有正确的 DATABASES在您的 settings .应该有一个名为 'default' 的数据库

关于django - South + Django 1.4 数据库错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10058035/

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