在Python2.7和Django 1.4中使用Window 7 64位。
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Django-1.4\django\bin\cms2>manage.py syncdb
Creating tables ...
Installing custom SQL ...
Installing indexes ...
Traceback (most recent call last):
File "C:\Django-1.4\django\bin\cms2\manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
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\base.py", line 196,
in run_from_argv
self.execute(*args, **options.__dict__)
File "C:\Python27\lib\site-packages\django\core\management\base.py", line 232,
in execute
output = self.handle(*args, **options)
File "C:\Python27\lib\site-packages\django\core\management\base.py", line 371,
in handle
return self.handle_noargs(**options)
File "C:\Python27\lib\site-packages\django\core\management\commands\syncdb.py"
, line 164, in handle_noargs
call_command('loaddata', 'initial_data', verbosity=verbosity, database=db)
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line
150, in call_command
return klass.execute(*args, **defaults)
File "C:\Python27\lib\site-packages\django\core\management\base.py", line 232,
in execute
output = self.handle(*args, **options)
File "C:\Python27\lib\site-packages\django\core\management\commands\loaddata.p
y", line 239, in handle
(full_path, ''.join(traceback.format_exception(sys.exc_type,
UnboundLocalError: local variable 'full_path' referenced before assignment误差
UnboundLocalError: local variable 'full_path' referenced before assignment我自己安装的,但它给我带来了错误。这是怎么回事?我试着用谷歌搜索,但什么也没出现。
发布于 2012-09-20 09:53:05
我也有这个问题。这是由(其他人)将此添加到我的settings.py中引起的。
SERIALIZATION_MODULES = {
'json': 'wadofstuff.django.serializers.json'
}我没有安装那个东西。您可以使用以下方法安装它:
pip install wadofstuff-django-serializers我认为其他丢失的软件也会出现类似的错误。
发布于 2012-09-24 05:40:11
这是Django吃了原来的异常、做了错误的事情并给出一个完全没有信息的错误的另一个例子。
查看逻辑流,您应该能够绕过这个错误,看看如果您这样做的话,实际的错误是什么。
manage.py syncdb --traceback或者也许
manage.py --traceback syncdb这应该会回答这个特定的问题,并告诉你Django里面出了什么问题。一旦你发现了这个问题,我建议你在一个新的问题中发布回溯,如果你还不知道到底出了什么问题。
发布于 2012-05-10 13:05:51
问题是,windows不知道如何处理python文件。要么更改windows设置,要么显式调用python:python manage.py。
https://stackoverflow.com/questions/10534566
复制相似问题