Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

学到markdown时有错误 custom markdown is not a valid tag library求指导 #20

Open
re-imagined opened this issue Mar 29, 2016 · 2 comments

Comments

@re-imagined
Copy link

Error during template rendering

In template /python_workspace/my_blog/templates/post.html, error at line 3

'custom_markdown' is not a valid tag library: Template library custom_markdown not found, tried django.templatetags.custom_markdown,django_admin_bootstrapped.templatetags.custom_markdown,django.contrib.admin.templatetags.custom_markdown,django.contrib.staticfiles.templatetags.custom_markdown

post.html

{% extends "base.html" %}
{% load custom_markdown %}
{% block content %}

            <h2 class="post-title">{{ post.title }}</h2>

                <p class="post-meta">

                    Time:  <a class="post-author" href="#">{{ post.date_time|date:"Y /m /d"}}</a> <a class="post-category post-category-js" href="#">{{ post.category }}</a>
  </p>
        </header>
@landyli
Copy link

landyli commented Jan 12, 2017

我也是在博客学到markdown时遇到错误了,不过看了你的代码段把我的问题解决了,以下为错误代码段
href="{% url "search_tag" tag=post.category %}”
应该是 href="#”

拨错信息为:
Error during template rendering

In template /root/python/ENV3.4/my_blog/templates/post.html, error at line 12
Reverse for 'search_tag' with arguments '()' and keyword arguments '{'tag': '1111'}' not found. 0 pattern(s) tried: []

post.html

<p class="post-meta"> Time: <a class="post-author" href="#">{{ post.date_time|date:"Y /m /d"}}</a> <a class="post-category post-category-js" href="{% url "search_tag" tag=post.category %}">{{ post.category }}</a> </p>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@re-imagined @landyli and others