页面未在django CMS Admin界面中显示

时间:2013-07-11 13:49:19

标签: python django django-admin django-cms

我最近一直在关注他们网站上提供的django CMS教程,在解决了一两个棘手的问题之后,我现在对当前的系统行为感到困惑。

在管理界面的页面部分,没有显示任何页面。界面目前如下所示:http://imgur.com/3QguvNZ

即使单击“添加页面”按钮并填写所有必填字段,也不会显示任何内容。以下代码显示在页面的HTML源代码中,我认为这可能与其中一个页面相关:

<li id="page_2" class=" moveable"" rel="topnode">
<div class="cont ">
    <div class="col1">
            <a href="2/" class="title" title="edit this page">None</a>
            <a href="2/" class="changelink" title="edit this page">edit</a>
    </div>
    <div class="col2">
        <span id="move-target-2" class="move-target-container" >
            <a href="#" class="move-target last-child" title="insert inside">↘</a>
        </span>
        <div class="col-softroot"><span class="icon softroot-icon" title="home"></span></div>
        <div class="col-language">
            <a href="2/?language=en" title="Edit this page in EN ">en</a>
        </div>
        <div class="col-actions">
            <a href="#" class="move" title="Cut" id="move-link-2"><span>cut</span></a>
            <a href="#" class="copy" title="Copy" id="copy-link-2"><span>copy</span></a>
                    <a href="./add/?target=2&amp;position=last-child" class="addlink" title="Add Child" id="add-link-2"><span>add</span></a>
            <a href="2/delete/" title="Delete" class="deletelink"><span>delete</span></a>
        </div>
        <div class="col-navigation">
            <label>
                <img alt="False" src="/static/admin/img/icon-no.gif" />
                <input type="checkbox" class="navigation-checkbox" name="navigation-2"  value="0" />
            </label>
        </div>
        <div class="col-published">
            <label><img src="/static/admin/img/icon-yes.gif" alt="True" /></label>
                <input type="checkbox" class="publish-checkbox" name="status-2" checked="checked" value="1" title="Unpublish"/>
            <a href="./2/preview/?public=1" title="View on page" class="icon selector-add viewpage" id="view-page-2"><span>view</span></a>
        </div>
        <div class="col-published">2013-07-11</div>
        <div class="col-view-perms"><span title="Restrictions: None"><img src="/static/admin/img/icon-unknown.gif" alt="None" /></span></div>
        <div class="col-lastchange">
        </div>
        <div class="col-creator">systems</div>
    </div>
</div>
</li>

正如您所看到的,代码中包含“剪切”和“在EN中编辑此页面”等各种按钮,但不会显示在页面上。

为了完整起见,这是我的urls.py文件中的相关代码:

from django.conf.urls.defaults import *
   from django.contrib import admin
   from django.conf import settings

   admin.autodiscover()

   urlpatterns = patterns('',
       (r'^admin/', include(admin.site.urls)),
       url(r'^', include('cms.urls')),

我创建的页面肯定存储在数据库中,这个问题只是它们没有被显示的情况。

 id | created_by | changed_by | parent_id |         creation_date         |         changed_date          |       publication_date        | publication_end_date | in_navigation | soft_root | reverse_id | navigation_extenders | published |    template     | site_id | login_required | limit_visibility_in_menu | level | lft | rght | tree_id | publisher_is_draft | publisher_public_id | publisher_state
----+------------+------------+-----------+-------------------------------+-------------------------------+-------------------------------+----------------------+---------------+-----------+------------+----------------------+-----------+-----------------+---------+----------------+--------------------------+-------+-----+------+---------+--------------------+---------------------+-----------------
  1 | systems    | systems    |           | 2013-07-11 11:34:18.216835+01 | 2013-07-11 11:34:18.216866+01 |                               |                      | f             | f         |            |                      | f         | template_1.html |       1 | f              |                          |     0 |   1 |    2 |       1 | t                  |                     |               1
  3 | systems    | systems    |           | 2013-07-11 11:42:45.476683+01 | 2013-07-11 11:42:45.47671+01  | 2013-07-11 11:42:19.135606+01 |                      | f             | f         |            |                      | t         | template_1.html |       1 | f              |                          |     0 |   1 |    2 |       3 | f                  |                   2 |               0
  2 | systems    | systems    |           | 2013-07-11 11:42:24.136515+01 | 2013-07-11 11:42:45.515485+01 | 2013-07-11 11:42:19.135606+01 |                      | f             | f         |            |                      | t         | template_1.html |       1 | f              |                          |     0 |   1 |    2 |       2 | t                  |                   3 |               0
(3 rows)

感谢。请告诉我是否还有其他任何内容可以帮助您找到解决方案。

1 个答案:

答案 0 :(得分:0)

通过向ADMIN_MEDIA_PREFIX添加尾部斜杠解决问题,使其显示为:

ADMIN_MEDIA_PREFIX - '/static/admin/'