使用'Djangocms'命令创建项目时失败

2024-04-25 19:58:52 发布

您现在位置:Python中文网/ 问答频道 /正文

  • Django CMS 3.4.1版
  • Django 1.10.2款
  • pip模块:http://pastebin.com/vJWvZVfA
  • 第8.1.2点
  • Python 2.7.12版
  • 操作系统:亚马逊Linux AMI发行版2016.03

我是Django CMS、Django和Python的新手。我以前的CMS经验是在WordPress上,我尝试用Django CMS作为WordPress的替代品,但是遇到了一个我似乎无法理解的错误。我已经更新了pip模块,并按照StackOverflow上线程中的建议安装了其他模块,但是没有用。在

我遵循了tutorial the instructions,除了djangocms命令,这在教程中是不正确的。(缺少-w标志。)

编辑:根据请求,下面是添加了--verbose标志的输出:

(env)[ec2-user@(redacted) tutorial-project]$ djangocms -d postgres://(redacted) -e no --permissions yes -l "en-CA, en-US, en, fr-CA, fr-FR" -p . --starting-page yes --verbose --utc mysite
Creating the project
Please wait while I install dependencies
Package install command: install django-cms<3.5 djangocms-admin-style>=1.2,<1.3 django-treebeard>=4.0,<5.0 psycopg2 djangocms-text-ckeditor>=3.2.1 djangocms-link>=1.8 djangocms-style>=1.7 djangocms-googlemap>=0.5 djangocms-snippet>=1.9 djangocms-video>=2.0 djangocms-column>=1.6 easy_thumbnails django-filer>=1.2 cmsplugin-filer>=1.1 Django<1.9 pytz django-classy-tags>=0.7 html5lib>=0.999999,<0.99999999 Pillow>=3.0 django-sekizai>=0.9 django-select2<5.0six
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-duWZSN/psycopg2/
The installation has failed.


*****************************************************************

Check documentation at https://djangocms-installer.readthedocs.io

*****************************************************************

Traceback (most recent call last):
  File "/home/ec2-user/env/bin/djangocms", line 11, in <module>
    sys.exit(execute())
  File "/home/ec2-user/env/local/lib/python2.7/site-packages/djangocms_installer/main.py", line 33, in execute
    verbose=config_data.verbose
  File "/home/ec2-user/env/local/lib/python2.7/site-packages/djangocms_installer/install/__init__.py", line 91, in requirements
    output = subprocess.check_output(['pip'] + args)
  File "/usr/lib64/python2.7/subprocess.py", line 574, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '[u'pip', u'install', u'django-cms<3.5', u'djangocms-admin-style>=1.2,<1.3', u'django-treebeard>=4.0,<5.0', u'psycopg2', u'djangocms-text-ckeditor>=3.2.1', u'djangocms-link>=1.8', u'djangocms-style>=1.7', u'djangocms-googlemap>=0.5', u'djangocms-snippet>=1.9', u'djangocms-video>=2.0', u'djangocms-column>=1.6', u'easy_thumbnails', u'django-filer>=1.2', u'cmsplugin-filer>=1.1', u'Django<1.9', u'pytz', u'django-classy-tags>=0.7', u'html5lib>=0.999999,<0.99999999', u'Pillow>=3.0', u'django-sekizai>=0.9', u'django-select2<5.0six']' returned non-zero exit status 1

编辑2:(移至回答)

编辑3:

在解决第一部分之后,另一个错误仍然存在。我会把它放在这篇文章里,因为它仍然属于标题的主题:

^{pr2}$

我想问题出在以下信息上:

settings.DATABASES is improperly configured. Please supply the NAME value. The installation has failed.

我使用的是PostgreSQL,所以我假设错误是由于命令参数中没有提供模式造成的。我在指南中没有看到如何提供它的说明,所以我要再搜索一些。在


Tags: installpipdjangoinpyenvoutputverbose
2条回答

错误信息告诉我什么也没有。它只告诉我Django试图使用pip来安装某些东西,不管是什么原因,它都失败了。为了找出问题所在,请尝试启用详细模式(python-v)。如果这给出了相同的输出,或者这不是一个选项,因为您正在使用一个调用Python的程序(听起来像是这样),请让我知道并准备进入源代码。相信我,我已经深入研究了Python实用程序的源代码,只要你不做任何蠢事(比如删除文件),就很难把事情搞砸。即使您这样做了,您仍然可以重新安装Django(或先备份)。别担心把你的电脑弄坏了。你得努力工作才能让Django做到!在

原始误差

非详细的错误消息以一种隐秘的方式指示错误,使用verbose可以提供更易于理解的消息。在

我遗漏了一个必需的模块(psycopg2),另外四个都是太新的版本(easy_thumbnails、Django、html5lib、Django-select2)。在

我卸载了这四个模块,然后使用命令中的版本要求重新安装了它们。e、 g.pip安装“Django<;1.10”。在

psycopg2需要额外的步骤,因为我在尝试安装它时收到一条错误消息,表明它找不到pg_config。另一个回答是,我只需要安装postgresql-devel。在我这样做之后,(sudo yum install postgresql-devel),我还卸载了postgresql8-libs,因为postgresql-devel附带了一个更新的版本。我以前没有这样做,因为yum表示PHP依赖关系,我不确定如果我这样做是否会引起问题。在

第二个错误

很简单。我缺少数据库URL的/NAME组件(postgres://USER:PASSWORD@HOST:端口/名称)。在

相关问题 更多 >