Closed slowfishc closed 10 years ago
你好,project中有代码依赖了markdown2,不过这个markdown2实际代码中没有用到。因此报错了。你有两个选择:
具体的报错在代码出现在文件: django_blog/apps/blog/templatetags.py下面
#! coding=utf-8
#import markdown2
import markdown
from django import template
from django.template.defaultfilters import stringfilter
from django.utils.encoding import force_unicode
from django. utils.safestring import mark_safe
register = template.Library()
#@register.filter(is_safe=True)
#@stringfilter
#def md2(value):
# '''
# 目前markdown2 无法处理井号(####)标题
# '''
# return mark_safe(markdown2.markdown(
# force_unicode(value),
# safe_mode=True)
# )
# return mark_safe(markdown2.markdown(value))
感谢,重新安装了markdown2之后好了,多谢多谢。
这个项目后续还有没有继续增强的计划?
在 2014-03-29 23:10:04,lzjun567 notifications@github.com 写道:
你好,project中有代码依赖了markdown2,不过这个markdown2实际代码中没有用到。因此报错了。你有两个选择:
— Reply to this email directly or view it on GitHub.
有很多,但都不是紧急的。比如:
好,我先把现有的熟悉下
在 2014-03-30 16:10:00,lzjun567 notifications@github.com 写道:
有很多,但都不是紧急的。比如:
— Reply to this email directly or view it on GitHub.
Environment:
Request Method: GET Request URL: http://localhost:8000/
Django Version: 1.6.2 Python Version: 2.6.6 Installed Applications: ('django.contrib.admin', 'django.contrib.auth', 'django.contrib.sites', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.sitemaps', 'reversion', 'apps.blog', 'pagedown', 'south', 'apps.bootstrap_pagination', 'compressor', 'debug_toolbar') Installed Middleware: ('django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware')
Template error: In template D:\zeero.zhang\app\python\web\django_blog\apps\blog\templates\index.html, error at line 2 'myapp_markup' is not a valid tag library: ImportError raised loading apps.blog.templatetags.myapp_markup: No module named markdown2 1 : {% extends "base.html" %}
2 : {% load myapp_markup %}
3 : {% load bootstrap_pagination %}
4 :
5 : {% block description %}FooFish的自话自说,Bloger,Enginner{%endblock%}
6 : {% block title %}FooFish的自话自说{% endblock %}
7 :
8 : {% block content %}
9 : {% for blog in blogs %}
10 :
11 :
12 : {{blog.title}}
Traceback: File "C:\Python26\lib\site-packages\django\core\handlers\base.py" in get_response
Exception Type: TemplateSyntaxError at / Exception Value: 'myapp_markup' is not a valid tag library: ImportError raised loading apps.blog.templatetags.myapp_markup: No module named markdown2