python3.3 manage.py syncdb语法错误

时间:2014-02-21 04:55:49

标签: python django syntax-error syncdb

Django很新 - 我正在尝试使用他们的指南在Webfaction上建立一个站点。 http://docs.webfaction.com/software/django/getting-started.html

我按照说明更新了settings.py,但是我的settings.py文件中出现语法错误。我已经尝试过并确保没有标签和空格。

以下是错误消息:

python3.3 manage.py syncdb
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/bstolte/webapps/mo_detector/lib/python3.3/django/core/management/__init__.py",    line 399, in execute_from_command_line
utility.execute()
File "/home/bstolte/webapps/mo_detector/lib/python3.3/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/bstolte/webapps/mo_detector/lib/python3.3/django/core/management/__init__.py", line 261, in fetch_command
commands = get_commands()
File "/home/bstolte/webapps/mo_detector/lib/python3.3/django/core/management/__init__.py", line 107, in get_commands
apps = settings.INSTALLED_APPS
File "/home/bstolte/webapps/mo_detector/lib/python3.3/django/conf/__init__.py", line 54, in __getattr__
self._setup(name)
File "/home/bstolte/webapps/mo_detector/lib/python3.3/django/conf/__init__.py", line 49, in _setup
self._wrapped = Settings(settings_module)
File "/home/bstolte/webapps/mo_detector/lib/python3.3/django/conf/__init__.py", line 128, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/usr/local/lib/python3.3/importlib/__init__.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1586, in _gcd_import
File "<frozen importlib._bootstrap>", line 1567, in _find_and_load
File "<frozen importlib._bootstrap>", line 1534, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 586, in _check_name_wrapper
File "<frozen importlib._bootstrap>", line 1024, in load_module
File "<frozen importlib._bootstrap>", line 1005, in load_module
File "<frozen importlib._bootstrap>", line 562, in module_for_loader_wrapper
File "<frozen importlib._bootstrap>", line 855, in _load_module
File "<frozen importlib._bootstrap>", line 982, in get_code
File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
File "/home/bstolte/webapps/mo_detector/mo_detector/mo_detector/settings.py", line 35
INSTALLED_APPS = (
             ^
SyntaxError: invalid syntax

有关为什么它在INSTALLED_APPS失败的任何想法?

1 个答案:

答案 0 :(得分:0)

通常当你得到类似于指向某些东西的语法错误时,你没有看到任何错误,这意味着文件中有一个未闭合的括号,缩进块或其他项目。 settings.py文件遵循正常的Python语法规则,就像任何其他.py文件一样,所以在该行之前查找可能导致解析器阻塞的内容。