There’s a new photo journal entry up!
The circus came to town. Frankeninferno. Camping in Perlenau. And a visit to the Neaderthal museum.
Websites and blogs of people that attended a Homebrew Website Club Düsseldorf.
There’s a new photo journal entry up!
The circus came to town. Frankeninferno. Camping in Perlenau. And a visit to the Neaderthal museum.
Usually I use nginx for static files, ssl termination and as a reverse proxy before my application servers. The django cookiecutter template came with a new webserver named caddy. It's written in go and https per default. Usually you have to fiddle around with certificates and a more or less complicated nginx config, but with caddy it was surprisingly easy. The certificate came from letsencrypt and it got installed automatically. After that my site got an A on the ssllabs ssl test page without any further tweaking. Caddy might be a bit slower than nginx, but it's probably fast enough for most people and solves an annoying problem. This is really cool.
Implementing pagination was also quite easy. Since I'm using class based views, I only had to add the attribute paginated_by = 5 to my view class and this snippet to my blogpost_list.html template:
{% verbatim %}<nav aria-label="pagination"> <ul class="pagination"> {% if page_obj.has_previous %} <li class="page-item"><a class="page-link" href="?page={{ page_obj.previous_page_number }}">previous</a><li> {% endif %} {% if page_obj.has_next %} <li class="page-item"><a class="page-link" href="?page={{ page_obj.next_page_number }}">next</a></li> {% endif %} </ul> </nav>