无法创建.db文件Django

时间:2013-10-30 21:56:03

标签: django sqlite

我正在使用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。

1 个答案:

答案 0 :(得分:0)

错误很明显。您尚未在settings.py中指定NAME。在你告诉它使用什么名称之前,Django无法创建数据库。