Django admindocs ReStructuredText无法正常工作

时间:2014-09-25 12:59:37

标签: django restructuredtext

我正在关注此link以生成我的Django V1.7项目文档,但它无法正常运行。例如,在下面提到的模型BlogEntry的文档字符串中,Blog.blogauth.User的链接未显示,而是显示为纯文本。

class BlogEntry(models.Model):
    """
    Stores a single blog entry, related to :model:`blog.Blog` and
    :model:`auth.User`.

    """
    slug = models.SlugField(help_text="A short label, generally used in URLs.")
    author = models.ForeignKey(User)
    blog = models.ForeignKey(Blog)
    ...

    def publish(self):
        """Makes the blog entry live on the site."""
        ...

但是对于下面提到的视图,除标题外,它的工作正常。

def my_view(request, slug):
    """
    Display an individual :model:`myapp.MyModel`.

    **Context**

    ``RequestContext``

    ``mymodel``
        An instance of :model:`myapp.MyModel`.

    **Template:**

    :template:`myapp/my_template.html`

    """
    return render_to_response('myapp/my_template.html', {
        'mymodel': MyModel.objects.get(slug=slug)
    }, context_instance=RequestContext(request))

0 个答案:

没有答案