/work-blog/2026-02-02-django-progress

Django Deployed! An odyssey


You're looking at my new website! Please excuse the dust, it's in its early development stages.

Intro

I've been rebuilding my website, to have more funcionality on the backend for future development, all while still serving all my old posts relatively unchanged, as well as supporting my markdown-enhanced lifestyle. To this end, I've been documenting my progress -- more than just in this work blog, with the idea that the process of documentation will: 1) Help me build a daily practice of writing that I can take into more pertinent engineering and documenation projects, and 2) Provide a test case for publishing (or self-publishing) small, digestible chunks of knowledge and providing them via my new website and/or other venues. I would like to try self publishing, setting up a payment portal, perhaps managing subscriptions, etc, but on a topic that I can fail on. This is a good test case for me.

Given those goals, now my website code actually needs to be clean and functional enough so that I'm not embarrassed when I show it off. I need to polish the turd, file off the sharp edges, and keep it relatively modular so that I can make more flexible decisions on the scope of this first project.

So last week I pushed my test website into production. Less pushed as in something you do in git, but more something a bird parent does to its chick off a tall building. I pushed it. It fell, caught itself, and fluttered to the ground, where it almost got hit by a truck. That was enough for me, however, to get started on the real work of getting the website functional, bug-free, and displaying all my posts in a better way. More importantly, I published it in its current state because it would keep me working hard at getting it working better, knowing that people might be looking at it.

So here it is. Look around and stay a while. Pardon the broken bits. I know about them and they're on a big list somewhere.

Last Week's Accomplishments

So last week I:

  • Updated all the dns handling and server routing so that https://danaukes.com pointed to my new server rather than my old github site.
  • got all my posts' media linking properly to my static file server
  • integrated a nicer html structure to my posts
  • cleaned up routing. Now that I understand url routing better, I was able to simplify and de-hard-code the way it finds files in a virtual filepath.
  • created a new "page" model that allows you to aggregate posts together and display them with a custom template.

    This is the basis for my landing page (index.html) but is flexible enough to create more complex "themed" pages. It gives me a hint that I could also move a lot of code into the database.

    • added import/export of page items
    • implemented a cool dynamic routing system so that if there is a page, its path is inserted at the top of my url routing list, ensuring that any page you add can be accessed.
    • Fixed a bug introduced in said cool routing logic when there are no pages.
  • added the image from yaml front matter if it exists to the post render.

    • created a new "replace_static" filter function for cases where I can't use django's functionality to replace with the STATIC_URL, such as yaml preamble variables. There could be a better solution than this, but it works.
  • fixed some basic image sizing issues in css

  • made a new "mvp" branch and removed almost all the code except the basic markdown example.

    the plan here is to display the different stages of my project, had I had the foresight to build it right -- and along a linear path -- from beginning to end. I will start with the simplest working example and add features and functionality, hopefully relating all the complexity I've learned about Django along the way in small doses.

  • Fixed bugs in and cleaned up date handling for my archive pages

  • simplified the differences in my settings.py file between my home test development setup and my remote server so that changes can be propagated more easily across the two.
  • made my post list page display a custom title depending on whether it was showing all posts, posts in a given subfolder, or posts from a given month.
  • Single-post folders, and display/navigation fixes

    • I finally fixed an issue brought on by my markdown code's structure. If I have a folder with a single markdown file in it called index.md, I want the folder's url to just act like the index.md page, rather than a list of child posts. This was how Hugo worked, and I don't want to change right away. I got that working.
    • Alongside the previous issue, any folder that only has one child should not show up in my list of subfolders, but in my list of posts.
    • I added the django setting to ignore the difference between urls with a trailing / and without.

    There is one latent issue, that if you go to https://danaukes/folder/subfolder/topic-folder/index, it will display the same as https://danaukes/folder/subfolder/topic-folder/

  • cleaned up pagination code so the buttons only show if there are multiple pages.

  • moved markdown code rendering from views.py to models.py. This is so other parts of my code can use post rendering functionality without importing an otherwise unnecessary model.
    • added new rendering code to permit access to html rendering on demand from the template. This permits me to render the title or other elements carried along in the yaml preamble, if need be.
    • added logic so that if there is a <!--split--> comment in my markdown, the render process will only render up to the split. This will permit me to specify per post where to cut the file for previewing.
    • one latent issue is that any Django tags buried in my markdown will be rendered rather than displayed. I need to figure out a fix for this
  • added new javascript based game with mobile-friendly drag and drop
  • Cleanup
    • cleaned up docker build
      • fixed double requirements.txt issue with working but not so clean fix for now.
      • removed unused packages and shortened number of layers
    • moved various environment variables to the same .env file
    • restructured docker folders and static files to share paths as much as possible between local and production branches
    • moved common functions to a new functions.py module
    • commented out / removed print statements
    • removed commented out code with no future purpose for now. It's there in git somewhere.
    • replaced hard coded urls with django url tags
    • updated the names of various view functions for more clarity
    • removed comment tags in html templates
    • removed unused libraries from imports
    • moved imports to top of python files

31 git commits later, it's working okay.

this week

So for this week, I have a few tasks

  • make a template for cards so my pages display better
  • get some color in my css
  • Finish my writeup for MVP1
  • Make MVP2, somewhere in between MVP1 and dev
    • decide on how much to add complexity wise
    • document that stage of development

About

I am an engineer and educator, having spent ten years as a professor. My goal is to help you build your knowledge of design and technology, get your hardware working, and propel your startup or small business. Get in touch!

Read More...