About Trojan Badger
This is Trojan Badger, a blog about Python, Django, Programming in generaly, and pretty much anything else I care to throw up here. Who am I? I wear many hats. I am a Lutheran Pastor, married with 6 children. I have a full time job in IT at a printing and display company. I also enjoy programming, and have fallen in love with Python, and the Django web framework in particular.
A bit about the codebase for this site. I implemented my CMS in order to consolidate a number of websites I manage. I also wanted to implement some custom app functionality, and I did not want to continue to program in PHP.
As a prerequisite, I wanted to utilize a single Django instance for all the sites. Django's built-in sites application could not fill this need, since what I really needed was the ability to dispatch a specific page from the database, based upon the domain name and URL. I was not interested in reusing apps in different Django-based domains, but serving all domains from a single app. The Django URL support does not give you access to the domain name. Therefore, I rolled my own site support. The glue is a piece of middleware that grabs the domain name, fetches a site object from the DB, and adds it as a parameter of the request object. This makes the site object available in all views.
All pages and content blocks, and most templates, stylesheets and images are stored in the DB. Pages are organized as an MPTT tree. There are custom tags for images, page object links, menus, etc. There is a generic post system which can be used for multiple news pages and blogs, each with their own RSS feeds, all served from a single table.
There's a lot more to do. The MPTT interface is clunky. I would like to convert it into a jQuery based drag-and-drop list. I would like to make the Admin interface "site aware", meaning it would only show pages in the domain through which the Admin is accessed. My next priority, however, will be to implement an archive widget for the sidebar.
What is a trojan badger? It's what you build when your trojan rabbit has failed.
I run or am affiliated with other sites:
