Skip to main content

Install and run Django completely inside Docker

This guide will show you how to install Django inside Docker with docker-compose and without installing any dependencies on the host system. Since there are a few quirks and I have to look it up myself every damn time, here's a guide hopefully helping me and other the next time.

This guide will:

  • help you install the newest version of django inside your docker container
  • be independent of your host OS and python version, so you can always get the newest version inside docker
  • provide a basic setup of django inside docker with docker-compose to build upon

    Read more…

G Suite for your personal domain and email

Using Google's G Suite for your personal domain allows you to use your domain with all of Google's tools. It includes Gmail (without ads), Meet, Calendar, Drive with > 30 GB, Docs, etc. What differentiates it from a regular Google account is that you can use your personal domain and thus your own email, e.g. After having used a G Suite of my company for a while, I wanted to have it for my personal email and domain, too.

Read more…

Add all models to Django admin automatically

To show, edit, and work with a model inside the Django admin site, you usually have to add each desired model manually by adding a line to {your app}/ For example, to add your Project class to your Admin site, you have to add the following to your file:

from django.contrib import admin
from myproject.myapp.models import Project

Over time, especially during development when you create new objects a lot, this can become quite tedious. So I cam up with a quick hack to add all models to your Django admin site automatically.

Read more…

Switching from Lektor to Nikola (static site generators)

I decided to migrate this website/blog from Lektor to Nikola. Both are static site generators implemented in Python that allow you to generate a static, secure, and maintenance-free website/blog. Here is my experience, why I did it, how to do it, and what to expect. In short: While I liked Lektor for its simplicity, it lacked several features I needed. So far, Nikola has these features and many more which is why I'm very happy to have switched. Read the rest of the pros and cons here.

Read more…

Django in Production with mod_wsgi and Docker

This article will show you how to run Django in production with docker and apache2/mod_wsgi. While there are several guides on how to do it, I found no simple enough tutorial on how to do it since all of the existing solutions require a lot of configuration or a custom docker image. The solution I found is way quicker and requires close to no configuration.

Read more…

How to recover an AWS EC2 instance without the private key

Lost the private key for your EC2 instance and can't login via ssh anymore? This tutorial will show you how to recover your EC2 instance by setting a new key pair to login.

What we'll do:

  • mount the original instance's volume (a.k.a. it's filesystem) inside another temporary EC2 instance
  • modify the keys allowed to login
  • unmount the volume from the temporary instance and re-mount it in the original instance
  • login with a new key to your original instance

In short, this replaces the key needed for ssh to connect with a new one of your choice.

Read more…

How to set up Black with Debian, PyCharm, and IdeaVim

I've come to like the code formatter Black for Python. It's opinionated, deterministic and thus very minimalistic. And since I'm using it on more and more projects, I wanted to integrate it into my workflow.

So usually, you just install Black globally via pip3 install black. But since I use Debian which still ships with Python 3.5 this yielded some smaller challenges as Black only runs under Python 3.6+. This post is a small tutorial on how you can use Black on Debian and integrate it into the command line, PyCharm, and IdeaVim.

Read more…

Keeping Pandas DataFrames clean when importing JSON (with Context Managers)

At First Momentum, I do a lot of data analysis to find the most promising young startups. As a first step, you always have to import the desired data into a Pandas DataFrame and do some preprocessing, for example by importing JSON data from some API.  When doing this kind of pre-processing, you usually have a lot of temporary columns in your DataFrame that get imported but need to be dropped later in the process. To deal with these temporary columns, I built a custom Context Manager that keeps track of all imported columns and deletes them when you're done. This way, your code stays lean and you don't have to remove temporary columns yourself. In this short article, I will show how you can keep your pre-processing clean and use a Python ContextManager to clean up temporary columns.

Read more…

Founding a Venture Capital Fund as a Techie: My Year 2018

I have long been thinking about writing a summary of my year to reflect on things and to be able to see how I saw the world in a few years. Also, if you haven't heard of me in 2018, this is the one article you should probably read.

As you probably know, I founded a venture capital fund, First Momentum, at the age of 27 in late 2017—at a point when I had not even finished university. Gladly, I graduated last year while getting the fund running, so this year was all about getting traction. Most notably this year, we managed to do our first closing and could since do our first investments. Personally, I started to lead the investing team at First Momentum, currently consisting of five people.

So here are my reflections on this year, my learnings, and my goals for 2019.

Read more…

Why every founder should use a notebook

For some time I have been using a notebook now. It's simple, analogue, and convenient nonetheless. I first noticed people using one in university, when we heard talks from founders at our university club. At that time, I bought one myself to try it out and have never looked back. And I think every founder should use one.

In this article I would like to articulate my love for notebooks. And I would like to help you get started using one. First, by talking about my usage. Secondly, by summarizing the benefits. And lastly, by giving some recommendations on which notebook to choose and how to structure it.

Read more…