Django Zinnia 无法在主页中 link 到 "weblog"

Django Zinnia cannot link to "weblog" within home page

我正在使用 Django Edge (v2.0) 模板,并创建了一个网站,这是我的主要项目,标题为:网站。在项目中,我着手实现一个博客,并安装了 Zinnia。我有以下内容:

Python 3.4.2 和 Django 1.7.7

我按照安装文档安装了 Zinnia,包括所有列出的依赖项,它可以正常工作。如果我导航到 127.0.0.0,它会将我带到网站项目的 "home page"。如果我导航 127.0.0.0/weblog/,它将带我到 Zinnia 的博客 "home page"。这一切都有效。但是,在网站的主页 (home.html) 上,我试图为 /weblog 创建一个 link,但似乎无法正常工作。我确定这只是语法,而且我缺乏知识。

我的项目结构如下:

├── LICENSE.txt
├── README.md
├── docs
│   └── index.md
├── requirements.txt
└── src
    ├── Website
    │   ├── __init__.py
    │   ├── __pycache__
    │   ├── settings
    │   ├── urls.py
    │   ├── views.py
    │   └── wsgi.py
    ├── accounts
    │   ├── __init__.py
    │   ├── __pycache__
    │   ├── templates
    │   ├── urls.py
    │   └── views.py
    ├── manage.py
    ├── profiles
    │   ├── __init__.py
    │   ├── __pycache__
    │   ├── templates
    │   ├── urls.py
    │   └── views.py
    ├── static
    │   ├── bootstrap
    │   └── site
    ├── templates
    │   ├── about.html
    │   ├── base.html
    │   ├── home.html
    └── zinnia
        ├── __init__.py
        ├── __pycache__
        ├── managers.py
        ├── markups.py
        ├── static
        ├── templates
        ├── urls
        ├── views

这是我的主菜 urls.py:

urlpatterns = patterns(
    '',
    url(r'^$', views.HomePage.as_view(), name='home'),
    url(r'^', include(accounts.urls, namespace='accounts')),
    url(r'^users/', include(profiles.urls, namespace='profiles')),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^weblog/', include('zinnia.urls', namespace='zinnia')),
    url(r'^comments/', include('django_comments.urls')),

)

在网站主页上,使用 home.html,我可以创建将我引导至其他页面的按钮,如下所示:

<a class="btn btn-default" href="{% url 'accounts:login' %}" role="button">Log in</a>

我基本上想要一个 "blog" 按钮,在我的主页上,它将把我重定向到 127.0.0.0/weblog/,所以我以同样的方式这样做:

<a class="btn btn-default" href="{% url 'zinnia:weblog' %}" role="button">Blog</a>

我收到这个错误:

Reverse for 'weblog' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []

更多信息:

In template /Website/src/templates/home.html, error at line 59
59       <a class="btn btn-default" href="{% url 'zinnia:weblog' %}" role="button">Log in</a>

如有任何帮助,我们将不胜感激,在此先感谢您。

我可能来晚了,但为了以防万一有人需要这个,这里是你如何获得博客根目录的 url

<a href="{% url 'zinnia:entry_archive_index' %}">Weblog</a>