需要帮助安装 django-cms
这个问题来自一位 Django 和 Django-cms 新手,他试图在共享主机帐户上安装 django-cms。这是我到目前为止所做的:
Django 已安装在 ~/.local/lib/python 中(使用 python 2.4.3)
Flup 也已安装在同一位置
创建了我的应用程序(站点)目录 - ~/.local/lib/python/eck
下载并提取了 django-cms 到 ~/.local/lib/python/eck
将 cms、mptt 和publisher 文件夹复制到 ~/.local/lib/ python/eck
这就是我被困住的地方。不知道从这里该做什么。我应该复制吗 将示例文件夹的内容放入 ~/.local/lib/python/eck 并 自定义现有的settings.py 文件?其他文件和文件夹呢?我应该将哪些复制到“eck”中?
“example”文件夹下有一个“sampleapp”文件夹。我该怎么办?
谢谢
TIA
This question is from a Django and Django-cms rookie attempting to install django-cms on a shared hosting account. Here's what I have done so far:
Django has been installed in ~/.local/lib/python (using python
2.4.3)Flup has also been installed in same place
Created my app (site) directory - ~/.local/lib/python/eck
downloaded and extracted django-cms into ~/.local/lib/python/eck
Copied the cms, mptt, and publisher folders into ~/.local/lib/
python/eck
That's where I'm stuck. Not sure what to do from here. Should I copy
the contents of the example folder into ~/.local/lib/python/eck and
customize the existing settings.py file? What about the other files and folders. Which ones should I copy into "eck?"
There is a "sampleapp" folder under the "example" folder. What do I do with that?
Thanks
TIA
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否首先在没有 Django-CMS 的情况下启动并运行 Django?我会首先担心这一点,然后担心安装 Django-CMS。您应该能够使用 django-admin.py 命令在 webroot 之外的某个位置创建一个项目。然后配置您的服务器以指向它 - 可能在 Apache 上使用 mod_wsgi 或 mod_python。我认为是前者,因为您正在安装 wsgi 工具包,但请确保您的共享托管提供商已安装 mod_wsgi。
另外,我不知道您的托管环境是什么样的,但您不需要在 Python 目录中创建项目。请参阅此答案,了解在哪里放置您的项目。
在安装了 Django-CMS 几次之后,在 Django 技术的不同水平上,我强烈建议首先专注于建立和运行一个 Django 项目框架!
Have you first gotten Django up and running, without Django-CMS? I'd worry about that first, and then worry about getting Django-CMS installed. You should be able to create a project somewhere outside of your webroot using the django-admin.py commands. Then configure your server to point to it - probably on Apache with either mod_wsgi or mod_python. I would think the former since you're installing a wsgi tools bundle, but make sure you shared hosting provider has mod_wsgi installed.
Also, granted I don't know what your hosting environment is like, but you shouldn't need to create your project in your Python directory. See this answer about where to put your project.
Having installed Django-CMS a couple times, at various levels of Django know-how, I would strongly suggest focusing on getting a skeleton Django project up and running first!
我完全同意 bennylope 的回答 - 确保你有一个 Django在尝试合并 django-cms 之前运行项目。
一旦您建立了 django 项目框架,您可能需要将其添加到根
urls.py
文件的底部:在您的
settings.py
文件中,确保您已将以下内容添加到INSTALLED_APPS
中:不必费心复制示例文件夹。但是,您确实需要设置起始 CMS 模板。
在您的根项目文件夹中,创建一个文件夹
templates
(如果您尚未这样做)。您需要创建一个用于输出 CMS 的文件,这是一个好的开始:确保添加
到您的设置文件中。
您负责设置
base.html
。无论您如何编写,请确保它在某处包含{% block content %}{% endblock content %}
,以便显示 CMS 模板的内容。我实际上建议不要将 django-cms 文件夹复制到 /eck 目录中。它们应该位于您安装中的
site-packages
或等效内容的任何位置。我最喜欢的设置方法是将 django-cms 放入/opt/
中,然后使用符号链接到site-packages
中的子文件夹。这可能不适合您,请与管理您的共享主机的人员联系,询问他们该怎么做,因为每个提供商的情况通常有所不同。但是,关键是您不希望 django-cms 文件夹与项目文件夹位于同一区域。在设置 django 项目时,我个人喜欢将专门为此项目编码的应用程序与其他应用程序分开。
I absolutely agree with bennylope's answer -- make sure you have a Django project running before trying to incorporate django-cms.
Once you do have the skeleton django project up, you'll probably want to add this to the bottom of your root
urls.py
file:In your
settings.py
file, make sure that you have added the following toINSTALLED_APPS
:Don't bother copying over the example folder. However, you do need to set up your starting CMS templates.
In your root project folder, create a folder
templates
if you haven't already done so. You need to create a file for outputing the CMS, here is a good start:Make sure to add
to your settings file.
You're responsible for setting up
base.html
. However you write it, make sure it includes{% block content %}{% endblock content %}
somewhere so the contents of the CMS template get displayed.I'd actually recommend against copying the django-cms folders into your /eck directory. They should be located wherever
site-packages
or the equivalent is located in your install. My favorite way to set this up is to put django-cms in/opt/
and then use symbolic linking to the subfolders insite-packages
. This may not work for you, get in touch with whomever manages your shared hosting to ask them what to do, as it is often different for each provider.However, the key is you don't want to have the django-cms folders in the same area as your project folders. When setting up a django project, I personally like to keep separate the apps I've coded specifically for this project from other apps.