I made my own content management system (CMS)

Why should you make your own CMS (Content Management System) ? There are many ready made and free solutions, so what is the point in creating your own?

For me this all started when I wanted to learn Python. Instead of following tutorials and examples that I both find boring and inefficient for my learning I decided on a project that actually has real value and use for me.

In addition I wanted the project to be something that I can keep building on as I progress in my learning, you are using my CMS right now :-)

The goal with this article is not to provide a guide on how to build a CMS, but I want to share with you my learning experience and provide hints about relevant topics and resources for you to pursue something similar.

What I already knew

  • I was already very familiar with REST API design.
  • I had been designing for the web to some extent before using modern html/CSS.
  • Pretty familiar with the http protocol.

Initial features

This is the list of features that I initially set out to build to have my minimum viable content management system for my needs.

  • Login

  • Create a form for creating and editing posts.

  • Creation of categories and basic metadata for posts.

  • Possibility to have a media endpoint for uploading and serving pictures..

  • Post category views with pagination to browse post archives.

  • Solution for formatting text in a multiline text field.

What I learned

The initial feature list may sound basic for someone who is very experienced with web development, or even python.


There are many fundamental things you will come across while doing this, basically you will get great exercise in.

  • Looping through structured data to build you pages etc.

  • JSON Maybe you decide to persist data using JSON format (like I did) in that case you will get familiar with that structure and how to efficiently design it.

  • HTML/Templates Generation of html/templates based on your persisted data.

  • Forms I decided to use HTML forms for Create new post, Settings and Profile options... I feel that this was a good design decision because although there might be more modern ways to achieve the same, forms is a good thing to get familiar with.

Project Structure

This was sort of my first bigger project in python, and to be completely honest I did not give structure that much thought in the beginning. This meant for me that I had most of my code in one big file,

I guess there are different thoughts around this but my advice would be to not worry too much about the structure in the beginning and instead focus on understanding how to get things to work and make the code do what you want it to.

Third party components used

There are so many modules for python with great documentation, what I found myself doing was googling python and the thing I wanted to do.

3rd Party

  • Flask, this is just a fantastic thing that allows you to build very useful things.. REST APIs? Websites? Not sure what it is categorized as really, maybe a development platform or framework?

    I think if you should focus on one thing in python to get started with a project like the one I am describing here, then flask is the first place to look I think.

  • Pillow, with this module you can manipulate pictures and probably much more.. this is very handy when you want to scale images for different use in your CMS (generate thumbnails for example)

  • OAuthLib, modern web authentication is done using Oauth2 or OpenID. With this module you have some nice ready made component to make use of token providers that are following these specifications.

    I use this to sign in to my site using my Google account, similarly you could use this to have others sign in to your site using their google account "Sign in with google"... the same would work with other providers also.

Features now

When I started to building and learn I found myself quickly get new ideas for things I wanted to add.

After having completed the list of Initial Features I ended up taking a break from this project to work on something else. This turned out quite useful for me, because when I came back I ended up revisiting much of the code I had written before and started to add new features.

  • Profile page where the user can add information about themselves as well as social integrations (social buttons, profile picture etc)

  • Possibility to upload multiple pictures to "blog posts", and subsequently the possibility to display them as a gallery within the post.

  • By using Pillow for python I could enhance the media gallery to automatically generate relevant sizes of pictures that was uploaded.

  • Added a field to post that can be used to embed external content to the post, this field works async and detects the format of the link you post.

  • Automatic generation of metadata derived from content, in addition I added fallback metadata in case none could be found.

  • I made both Google Analytics and Adsense a configurable under settings.

  • More...


I am working on a recorded demo for this, stay tuned!