← Back to blog

A new beginning

Building a Django Blog with Markdown

After years of fighting with WordPress, I decided to build my own blogging system. Here’s why and how I did it.

The Problem with WordPress

Don’t get me wrong - WordPress is powerful. But for a developer who just wants to write posts in their favorite editor, it feels like overkill. The constant updates, plugin management, and database overhead just got tiring.

The Solution: Django + Markdown

I love working in Django, and I write everything in Markdown anyway. So why not combine them?

The Architecture

# Simple blog post structure
posts/
├── 2024/
│   ├── 10/
│   │   └── my-first-post.md
│   └── 11/
│       └── another-post.md
└── index.json

Each post is just a Markdown file with frontmatter:

---
title: "My Post Title"
slug: my-post-title
date: 2024-10-15
tags: [django, python]
summary: "A brief summary..."
---

## Your content here

The Benefits

  1. Version Control - All my posts are in Git
  2. Simple Deployment - Just git push to publish
  3. Fast - Static content, no database queries for content
  4. Editor Freedom - Write in PyCharm, VS Code, whatever
  5. Portable - Just markdown files, easy to migrate

Implementation Details

The magic happens in a simple utility class that:

  1. Reads markdown files from disk
  2. Parses frontmatter for metadata
  3. Renders markdown to HTML with syntax highlighting
  4. Caches the rendered output

Performance

With proper caching, this approach is lightning fast. The markdown is only parsed once, then cached. Subsequent requests serve the cached HTML.

Conclusion

Sometimes the simplest solution is the best. This blog is now easier to maintain, faster to deploy, and more enjoyable to write for.

Want to build something similar? Check out my tutorials section for a step-by-step guide!