Django Simple Publishing
3 November, 2013
When building Yard Diary, which uses Django for the backend server parts, I saw a need for a simple publishing system to manage the static parts such as the landing page, this blog, some help pages and similar. Looking around I didn't find anything that seemed to fit what I was looking for, something that:
- Is simple to integrate alongside other Django apps
- Has a nice editor that makes it easy to write new content
- Can manage several different parts of the site, such as /help, /blog, etc.
- Has good enough performance (not too slow)
Using an external blog or CMS seems suboptimal as well, since it would make it harder to integrate content from the site's main apps or require parts of the site to be moved to subdomains (which is not optimal for SEO).
Since I couldn't find anything quite fitting I put together a simple publishing system myself over a few evenings and weekends. It is consciously made as simple as possible, though there are a few more features needed.
It is very easy to integrate, just add it as an installed app, add a urlconf entry for where you want it, and run the database migrations. See for yourself in the documentation on Github.
Screenshot of the editor
The editor took the most time to put together. It's built using Ember.js (since this is what I use for Yard Diary itself it was a natural choice). There's a sidebar where you find your pages and can add new ones, and there is a split content area where you write your content in markdown on the left and get a realtime preview on the right. I'm quite happy with it, and putting it together with Ember was very smooth and enjoyable.
The one big missing feature right now is the ability to easily add images to your pages. This I really need to get done, and it shouldn't be too hard to put together. I'll probably use the excellent jQuery File Upload to handle uploads directly to S3 or you server, and then make the images available for use in the markdown content as named references. This should make it quite flexible.
Another feature I'm thinking of is offline generation like in Jekyll where the whole site is rendered to HTML when saved instead of when accessed for some really good performance. I'll probably not write it to files but use Redis or a database as backend instead. The basic idea is simple but there are some tricky stuff to work out, such as how to handle scheduled publishing.
Published by Olof Sjöbergh on 3 November, 2013.comments powered by Disqus
© Tokotoko Studio 2013