0

我正在使用 sqlite3,并且在我使用 python manage.py syncdb 之后它应该创建一个数据库文件(称为 sqlite3.db)它不这样做。我尝试搜索该文件,并尝试以管理员和普通用户身份运行所有命令。到目前为止没有运气。

这里出了什么问题?我真的很感激这里的一些帮助!

这是回溯:

Traceback (most recent call last):
File "manage.py", line 14, in <module> execute_manager(settings)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 438, in execute_manager utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 379, in execute self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 191, in run_from_argv self.execute(*args, **options.__dict__)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 220, in execute output = self.handle(*args, **options)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 351, in handle return self.handle_noargs(**options)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/syncdb.py", line 56, in handle_noargs cursor = connection.cursor() 
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/__init__.py", line 250, in cursor cursor = self.make_debug_cursor(self._cursor())
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/sqlite3/base.py", line 201, in _cursor raise ImproperlyConfigured("Please fill out the database NAME in the settings module before using the database.") 
django.core.exceptions.ImproperlyConfigured: Please fill out the database NAME in the settings module before using the database.

顺便说一句,我没有使用最新的 Django。我正在使用 Django 1.3 我的操作系统是 Linux Mint。

4

1 回答 1

0

错误很明显。您尚未在 settings.py 中指定名称。除非您告诉它使用什么名称,否则 Django 无法为其创建数据库。

于 2013-10-30T22:28:40.490 回答