我在base.txt文件中安装了pinax要求
现在当我做python manage.py syncdb时,我得到:
Traceback (most recent call last):
File "manage.py", line 20, in <module>
execute_from_command_line()
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line
443, in execute_from_command_line
utility.execute()
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line
382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line
261, in fetch_command
klass = load_command_class(app_name, subcommand)
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line
69, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "C:\Python27\lib\site-packages\django\utils\importlib.py", line 35, in im
port_module
__import__(name)
File "C:\Python27\lib\site-packages\django\core\management\commands\syncdb.py"
, line 8, in <module>
from django.core.management.sql import custom_sql_for_model, emit_post_sync_
signal
File "C:\Python27\lib\site-packages\django\core\management\sql.py", line 6, in
<module>
from django.db import models
File "C:\Python27\lib\site-packages\django\db\__init__.py", line 40, in <modul
e>
backend = load_backend(connection.settings_dict['ENGINE'])
File "C:\Python27\lib\site-packages\django\db\__init__.py", line 34, in __geta
ttr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "C:\Python27\lib\site-packages\django\db\utils.py", line 90, in __getitem
__
self.ensure_defaults(alias)
File "C:\Python27\lib\site-packages\django\db\utils.py", line 80, in ensure_de
faults
conn.setdefault('TIME_ZONE', 'UTC' if settings.USE_TZ else settings.TIME_ZON
E)
File "C:\Python27\lib\site-packages\django\utils\functional.py", line 185, in
inner
return func(self._wrapped, *args)
AttributeError: 'Settings' object has no attribute 'USE_TZ'
我真的不知道如何解决这个问题。因此,我很满意我得到的每一个想法/建议!
答案 0 :(得分:0)
通常意味着 - 即使错误实际上根本没有帮助 - 当Django尝试导入您的设置文件时,会发生某种语法或导入错误。
尝试打开一个shell并手动导入设置模块以查看您获得的异常(如果有):
manage.py
的目录中打开命令提示符(或Powershell)。DJANGO_SETTINGS_MODULE
中的manage.py
设置。它可能是project.settings
。import project.settings
或其他什么。可能会发生异常。修复它:)YMMV,希望这会有所帮助......