More article features and markdown editor

Displaying user article statistics in the template

Want more?

This lesson for enrolled students only. Join the course to unlock it!

You can see the code changes implemented in this lecture below.

If you have purchased the course in a different platform, you still have access to the code changes per lecture here on Teclado. The lecture video and lecture notes remain locked.
Join course for $15

Modified files

djangocourse/settings.py
--- 
+++ 
@@ -41,6 +41,7 @@
     'django.contrib.sessions',
     'django.contrib.messages',
     'django.contrib.staticfiles',
+    "django.contrib.humanize",
 ]

 THIRD_PARTY_APPS = [
templates/app/home.html
--- 
+++ 
@@ -1,7 +1,15 @@
 {% extends "app/base.html" %}
+{% load humanize %}

 {% block content %}
   <h1>Articles</h1>
+
+    <p>
+      You have created {{ user.article_count | intcomma }}
+      article{{ user.article_count | pluralize }}
+      and written {{ user.written_words | intcomma }}
+      word{{ user.written_words | pluralize }}.
+    </p>

   <a href="{% url 'create_article' %}">Create article</a>