Skip to content

Commit e50ca06

Browse files
committed
Fixed staticfiles ModuleNotFound error on Emoji's
1 parent 249a676 commit e50ca06

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

martor/extensions/emoji.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
from ..settings import (
33
MARTOR_MARKDOWN_BASE_EMOJI_URL,
44
MARTOR_MARKDOWN_BASE_EMOJI_USE_STATIC)
5-
from django.contrib.staticfiles.templatetags.staticfiles import static
5+
try:
6+
from django.contrib.staticfiles.templatetags.staticfiles import static
7+
except ModuleNotFoundError:
8+
from django.templatetags.static import static
69

710
"""
811
>>> import markdown

martor_demo/app/templates/base.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% load staticfiles %}<!DOCTYPE html>
1+
{% load static %}<!DOCTYPE html>
22
<html lang="en-us">
33
<head>
44
<title>{% block title %}{% endblock %} :: Martor</title>

martor_demo/app/templates/test_markdownify.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% load staticfiles %}
1+
{% load static %}
22
{% load martortags %}
33
<!DOCTYPE html>
44
<html lang="en-us">

0 commit comments

Comments
 (0)