Articles by Per Wagner Nielsen

  1. Sanic Web Tutorial Part 2 - Templates

    In Part 2 we will setup Sanic to render html templates.

    Install and setup Jinja2 extension

    We will enable our application to render Jinja2 templates. Jinja2 is a template engine developed by Armin Ronacher (the developer of Flask and many other things) and documentation for the project can be found …

    Tagged as : sanic web tutorial
  2. Sanic Web Tutorial Part 1

    Welcome to my Sanic Web Tutorial where you will learn to use the async web framework Sanic to create and deploy your own website.

    Assumptions

    I assume that you are familiar with using Python and virtualenv, but you do not need to be an expert. You should be able to …

    Tagged as : sanic web tutorial
  3. Vagrant, Ansible and Posgtresql

    How to setup Vagrant, Ansible and Postgresql

    In this story I’ll be setting up Vagrant with a Postgresql server provisioned by Ansible. The setup will be pretty bare bone, so don’t use it as a blueprint for a production setup.

    Setup Vagrant

    Create a file named ‘Vagrantfile’ in …

    Tagged as : vagrant deployment
  4. Django's select_related

    How does Django's select_related works and when should you use it?

    What problem does it solve?

    Django's select_related() solves the problem when you want to access related fields on a queryset. Assume the models:

    from django.db import models
    
    
    class Author(models.Model):
        name = models.CharField(max_length=250)
    
    
    class Book …
    Tagged as : django orm
  5. IP address and subnets (IPv4)

    This blog post will show how IP addresses work, what subnetting is.

    Binary to decimal for two byte numbers

    First, it can be beneficial to memorize the following table, which is just a list of binary digits.

    128  64  32  16  8  4  2  1
    

    It makes it easy to …

    Tagged as : network

Page 2 / 2