Ephes Blog

Miscellaneous things. Not sure what to put here, yet.

Using a CDN

, Jochen
Today I switched from serving media files directly from s3 to cloudfront. The main reason is that s3 only supports http/1.1 while cloudfront also does http/2 which is much faster because images etc. could be downloaded in parallel.

PyCon 2017

, Jochen
PyCon 2017 is over now and I liked it a lot. It was a really well organized event and the talks were great. I already knew the conference location because I lived only a few hundred meters away for a long time. So it didn't came as a surprise for me that it was awesome.

On my way to pycon

, Jochen
Decided to join this years pycon/pydata conference in Karlsruhe. Since this was my home town for a long time, I'm looking forward to meet  friends and family. The conference schedule is filled with data science talks, so it should be quite interessting for me :).

The train is quite empty, so maybe I'll be able to work on some blog stuff til Karlsruhe:

Added rudimentary gallery support

, Jochen

Thought it would be nice to have multiple images in an entry. But then they should not all be shown in full size. So I misused the modal component of bootstrap for that. Still have to figure out how to make landscape images wider and portrait pictures smaller, but it's a start.

Here are three images from the pyddf meeting of last week:

Added pagination

, Jochen

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 %}
{% endverbatim %}