Modified files
templates/app/article_update.html
---
+++
@@ -12,4 +12,16 @@
<a href="{% url 'home' %}">Back to list</a>
<a href="{% url 'delete_article' article.id %}">Delete article</a>
-{% endblock content %}+{% endblock content %}
+
+{% block page_js %}
+<script>
+const contentMarkdown = new EasyMDE({
+ element: document.getElementById("id_content"),
+ spellChecker: false,
+ status: false,
+ toolbar: false,
+ forceSync: true
+});
+</script>
+{% endblock page_js %}
templates/app/base.html
---
+++
@@ -4,6 +4,8 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Djangocourse</title>
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/easymde/dist/easymde.min.css">
+ <script src="https://cdn.jsdelivr.net/npm/easymde/dist/easymde.min.js"></script>
</head>
<body>
<nav>
@@ -25,5 +27,8 @@
{% endblock content %}
<footer>Common footer for all templates</footer>
+ {% block page_js %}
+
+ {% endblock page_js %}
</body>
</html>
templates/app/article_create.html
---
+++
@@ -9,4 +9,16 @@
</form>
<a href="{% url 'home' %}">Back to list</a>
-{% endblock content %}+{% endblock content %}
+
+{% block page_js %}
+<script>
+const contentMarkdown = new EasyMDE({
+ element: document.getElementById("id_content"),
+ spellChecker: false,
+ status: false,
+ toolbar: false,
+ forceSync: true
+});
+</script>
+{% endblock page_js %}