知道我为什么会收到这个错误吗?

时间:2011-03-25 20:27:03

标签: python django ubuntu django-cms

我正在尝试在我的ubuntu pc中安装django-cms。我收到了这个错误:

    Traceback (most recent call last):
  File "manage.py", line 14, in <module>
    execute_manager(settings)
  File "/usr/local/lib/python2.6/dist-packages/django/core/management/__init__.py", line 438, in execute_manager
    utility.execute()
  File "/usr/local/lib/python2.6/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.6/dist-packages/django/core/management/base.py", line 191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/local/lib/python2.6/dist-packages/django/core/management/base.py", line 209, in execute
    translation.activate('en-us')
  File "/usr/local/lib/python2.6/dist-packages/django/utils/translation/__init__.py", line 100, in activate
    return _trans.activate(language)
  File "/usr/local/lib/python2.6/dist-packages/django/utils/translation/trans_real.py", line 202, in activate
    _active.value = translation(language)
  File "/usr/local/lib/python2.6/dist-packages/django/utils/translation/trans_real.py", line 185, in translation
    default_translation = _fetch(settings.LANGUAGE_CODE)
  File "/usr/local/lib/python2.6/dist-packages/django/utils/translation/trans_real.py", line 162, in _fetch
    app = import_module(appname)
  File "/usr/local/lib/python2.6/dist-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/usr/local/lib/python2.6/dist-packages/cms/__init__.py", line 14, in <module>
    patch_settings()
  File "/usr/local/lib/python2.6/dist-packages/cms/conf/__init__.py", line 32, in patch_settings
    post_patch()
  File "/usr/local/lib/python2.6/dist-packages/cms/conf/patch.py", line 26, in post_patch
    settings.CMS_TEMPLATES = tuple(settings.CMS_TEMPLATES) + (
TypeError: 'NoneType' object is not iterable

知道为什么会出现这个错误?

感谢 编辑-1 - 嗨,大家好, 是的你是对的我没有把cms_templates放在settings.py中。我现在就做了,但现在我收到了这个错误。

DatabaseError at /

没有这样的表:cms_page

请求方法:GET 请求网址:http://localhost:8000/ Django版本:1.3 异常类型:DatabaseError 例外值:

没有这样的表:cms_page

异常位置:执行中的/usr/local/lib/python2.6/dist-packages/django/db/backends/sqlite3/base.py,第234行 Python可执行文件:/ usr / bin / python Python版本:2.6.6 Python路径:

[ '/家/纳温/ django_projects / myproject的',  '/usr/local/lib/python2.6/dist-packages/pip-0.8.3-py2.6.egg',  '/usr/lib/python2.6',  '/usr/lib/python2.6/plat-linux2',  '/usr/lib/python2.6/lib-tk',  '/usr/lib/python2.6/lib-old',  '/usr/lib/python2.6/lib-dynload',  '/usr/local/lib/python2.6/dist-packages',  '/usr/lib/python2.6/dist-packages',  '/usr/lib/python2.6/dist-packages/PIL',  '/usr/lib/python2.6/dist-packages/gst-0.10',  '/usr/lib/pymodules/python2.6',  '/usr/lib/python2.6/dist-packages/gtk-2.0',  '/usr/lib/pymodules/python2.6/gtk-2.0']

服务器时间:2011年3月25日星期五15:34:04 -0500

4 个答案:

答案 0 :(得分:2)

正在寻找settings.CMS_TEMPLATES。它试图使None成为一个会引发错误的元组。

确保您已定义CMS_TEMPLATES

http://docs.django-cms.org/en/2.1.3/getting_started/tutorial.html#configuration-and-setup

答案 1 :(得分:1)

您的CMS_TEMPLATES设置为无,我不知道那是什么,但我猜它是您需要在某处配置的设置。

答案 2 :(得分:1)

我相信

settings.CMS_TEMPLATESNone。如果没有相关代码的样本,很难说清楚。

答案 3 :(得分:1)

参考编辑1:

您使用的是哪些命令?您是否关注tutorial?我想你没有这样做:

python manage.py syncdb

如果您刚编写模型,此命令将在数据库中创建表。否则数据库为空,这就是Django无法找到cms_page表的原因。