HotWire's Turbo with Django Bootstrap 5

If you use turbo and django-bootstrap5 drop downs will not work once you load another page. You can fix this by adding the data-turbolinks-eval=false attribute to bootstrap’s <script>.

settings.py

from django_bootstrap5.core import BOOTSTRAP5_DEFAULTS

BOOTSTRAP5 = {
    "javascript_in_head": False,
    "javascript_url": BOOTSTRAP5_DEFAULTS["javascript_url"].copy()
}
BOOTSTRAP5["javascript_url"]["data-turbolinks-eval"] = "false"
#django #hotwired #turbo

Higher level protocols for websockets

I ran across WAMP recently. When I built my DC++ client who’s primary GUI is a jquery/jquery ui web app connected to the twisted python backend via websocket I had to create something just like this. Later reading over the JSON RPC 2.0 spec I realized you could just use their format and leverage json rpc libs already written.

Small note: you might want to remove the “jsonrpc” key from the request and response to save some bytes.

There is also this: Cutting Down Bandwidth with JSON Alternatives

#ideas

Google Glass App Idea: Am I talking to my kids enough?

The Power of Talking to Your Baby

If you haven’t heard of Hart and Risley’s work, you are not alone — and you may be wondering why. These findings should have created a policy whirlwind: Here was a revolutionary way to reduce inequities in school achievement that seemed actually possible. How hard could it be to persuade poor parents to talk to their children more?

Very hard, it turned out — because there was no practical way to measure how much parents talk. Each hour of recording took many hours to transcribe and classify: to count the words uttered near a child and attribute them to a parent, the main child, a sibling, someone else or a TV. The cost was prohibitive.

With Google Glass you could monitor everything you say, you could track if your kids are around you.

#ideas

txspdy: Day 4: frames and streams oh my

Last night was light on hacking time. Did a lot of reading of the twisted.web code. What I would like to end up way to create a duel https/spdy exposing the same Resource instance tree. Unfortunately it seems like the Site class is a subclass of a HTTPFactory where it would be better for this if it had a ref to that factory.

I used some code from nbhttp to parse the frames and frame headers for a single request. Next up is creating the headers and response frame. Then we’ll have enough for a “hello world”.

#txspdy

txspdy: Day 3: pyopenssl done... now to python code

I don’t know where to start talking about the problems with building your own copy of Openssl. Ubuntu has added a few patches, one of which adds symbol versioning to the openssl shared libraries. Sounds great, but it means you can’t build a new version of openssl from upstream and install it system wide without problems, like say your openssh server dies because of it and you can’t login. I have a monitoring system, icinga, that noticed this and sent emails/txt msgs about it so I fixed the problem before finding myself locked out of the system.

Once that was settled I got the three new methods added to pyopenssl and made a test as well. I’ve sent it upstream to get merged. You can see it at LaunchPad.

Now I’m writing a twisted protocol that will parse SPDY frames. The frames build to multiple streams, and I’m not sure how to deal with those. Maybe there is some other multiplexing protocol like this already in twisted.

#txspdy