I’m thinking again of doing some work on lolslackbot, in particular adding a web frontend to it. Tired of adding users with ugly SQL hacks, tired of having no reporting views. I experimented with using Django six months ago and even sort of still have the code but have totally forgotten how it worked. I also never came to a conclusion about the path forward. In particular whether I should add Django first, or I should port from sqlite to postgres first.
Well I’m cutting that Gordian knot based on 30 seconds advice on IRC. I should add Django first, Django + sqlite. It should all work fine, the only drawback is sqlite database level locking will suck with multiple web users. Which is fine for now. Adding Django lets me add new features to the product, which is what motivates me. I’ll port to sqlite later if I open the webapp to multiple users and need better locking. A rough plan:
- Get some basic read-only views of the database
- Related: sort out my problem with representing many-to-many relationships. I fear this might require changing my database schema to be compatible with Django’s way of doing things.
- Focus on the social tables: People, Groups, Destinations. Create views like “who is in which group” and “where do these messages for this group go?”
- Also do some reporting, like “show last 10 messages sent” and “how many messages total are we sending a day?”
- Implement some basic tests for the Django code so I have a test environment for Django database code.
- (Cautiously) add some write capability for the social tables. Like “Add this person to be tracked” and “add this person to a group”.
- Take a deep breath! Stuff is working!
- Work on a plan to let other people log in and add users / groups.