Reminiscing this and that, on the web since 1995

inlägg från 2018

Nicer URL mappings in Django

Published tagged , , .

URL mappings in django consists more or less of a list of (regex, handler) tuples, if the regular expression matches the requested URL, the handler is used to serve the request. The regular expressions themselfes tends to be rather long and not as readable as I would want them to. Let's see if we can fix that.

Update : Django 2.0 was recently released and supports a scheme simliar to what I present here (but more generic). If you use this, consider upgrading to Django 2.0 and see the documentation on the URL dispatcher.

Läs och kommentera inlägget Nicer URL mappings in Django

Rust and the web in 2018

Published tagged , , , .

There is A Call for Community Blogposts over at the Rust Programming Language Blog. This is my entry.

I mainly do "server-based" web service development. The server sends html, css, images, and javascript to the browser. The javascript implements progressive enhancement for the content, but the site should be usable and as nice as possible even with javascript disabled. So while I certainly do RESTful json API:s, I also do server-side html templateing, css (and scss) minification, etc. I think Rust has great potential here, partly because of optimization and execution speed, but mainly because the type safety and fearless concurrency make it easy to actually get things right and avoid unpleasant surprises at runtime.

My wish for Rust in 2018 is a nice and convenient web service framework that runs on stable rust and gets maintenance and regular updates for many years to come. My intent for 2018 is to continue to maintain and improve ructe (and rsass), and try to integrate it with the best such framework i can find.

I currently have two web service projects in rust: homesite is a trivial example using iron and rphotos (https://img.krats.se/) is a more ambitious photo gallery / management app using nickel. Unfortunately, both iron and nickel seems more or less abandoned, as both still depend on hyper version 0.10.

Rocket.rs seems awesome, but requires unstable rust, and I would prefer to build my projects with the stable toolchain.

Maybe gotham can be the framework I'm looking for? I think it needs a lot easier request routing and path extraction, but there seems to be work going on to fix that. And maybe that is something I can help create? There are some issues tagged discussion and help wanted which might provide good starting points. And there is the Gotham book to read.

Or maybe either iron or nickel will make a comeback? There are open issues in both about working with hyper version 0.11 (iron#501 and nickel.rs#402), even if they haven't seen much activity recently.

Write a comment


Published tagged , , , , , , .

Jag har inte lagt upp någon propagandacykling här på bloggen på ganska länge. Naturligtvis cyklar jag fortfarande till jobbet de flesta av de dagar jag inte jobbar hemifrån, och jag brukar ta en bild och lägga ut på twitter.

Men jag har ett projekt för att organisera mitt bildarkiv på gång också. Det har kommit så långt att det är smidigare att lägga upp mina bilder där än här. Så vill du se mina samlade cykelbilder så finns de där!

Men jag får väl inkludera tre ganska färska bilder här också.


Write a comment

Fedora supplemental wallpapers

Published tagged , , .

The election of Fedora Supplemental Wallpapers for Fedora 28 has been open a few days, and I have contributed the following two images:

Image: Ribbons
Image: Stone wall at Soumenlinna, Helsinki.
Stone wall at Soumenlinna, Helsinki.

As usual, I don't doubt that others have submitted more stunning images, but I also think these are good background images, as I find them nice enough to look at while beeing plain enough to stay in the background (and yes, the images submitted are in much higher resolution than shown on this site).

The voting is open to Fedora contributors only. If you are a contributor, please consider voting, either on my contributions or on something else (or both, each voter can vote for 16 images). Voting is open until 2018-02-26.

Write a comment

Övriga inlägg från 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018.