• A Python Script for fast changes of network config on Windows Python

    I wanted to be able to switch fast between different network configurations on my Windows development PC without using any kind of 3rd party software. So I had a quick look on Stackoverflow and found the beautiful wmi package. Windows Management Instrumentation (WMI) is Microsoft’s implementation of Web-Based Enterprise Management (WBEM), an industry initiative to provide a Common Information Model (CIM) for pretty much any information about a computer system. And the wmi package is a Python wrapper for it on top of pywin32.

    Read more
  • Handling modal forms with Flask Python Flask

    Modal dialogs are quite common in GUI programming. They help to focus the users attention on the task at hand but still outline the context of the given or needed information by keeping the parent object visible in the background. As I have been doing a lot of classic GUI programming with PyQt I like to use modal dialogs and it feels natural for me to use them as well in Flask Web Applications. Bootstrap provides a great and simple way to create a modal dialog which is just what we want. However things get a bit more complicated when it comes to dealing with forms in modals. It took me a while to figure out a solution I am comfy with and I want to describe my solution in the following.

    Read more
  • Creating a Flask application container with Docker Python Flask

    A while ago I wrote a post about how to serve a Flask application on a webserver. Today I want to write about how to achieve this by using a docker container. Using a container for deploying web applications has the main advantage of shipping an isolated environment in a Black Box to its destination. So you don' t depend on the server operating system or the configuration. You don' t have to worry about the right version of Python being installed and so on. Also the whole shipping mechanism via Docker Hub works great. So let' s get moving.

    Read more
  • Setting up a Debian VM with Vagrant on Windows Linux

    As a developer I endeavor to keep a consistent working environment on all of my computers. Meaning editing with VIM, version-controlling with GIT and using all the cool POSIX tools directly from the Terminal to do whatever. At home I use Mac OS X and for servers I use Debian. So working with the terminal is basically the same for both systems.

    Unfortunately on Windows it is not as easy to setup a proper toolchain as it is not a Posix compliant operating system. So instead of a powerful shell like Bash with lots of helper tools you get the Commandline with almost nothing. Luckily there is Cygwin which brings some kind of Linux-flaire to Windows by providing Posix tools and a nice terminal called mintty. Still it is not the same as running on Linux but it is a step in the right direction. The main drawback using Cygwin is that you are still on Windows. Meaning you can't just clone a Github repository and compile it. When you do so there is always something missing. Also you keep running into trouble with Cygwins way of putting all drives in /cygdrive instead of using the native drive letters on Windows. So to get the real Linux feeling I decided to actually use real Linux ... in a virtual machine.

    Read more
  • Flask-Admin: Handle image selection Python Flask

    In my last post Checking out: Flask-Admin extension I gave a short introduction to the Flask-Admin extension. I also built a small example to show how easy it is to get a basic admin interface for your data. But how does Flask-Admin work if we have more advanced requirements? For example what if we want to provide an image for each user? In this case we will have to expand our recent example by an Image model.

    Read more
  • Checking out: Flask-Admin extension Python Flask

    In my recent projects I often ran into the important but boring task of building admin interfaces on top of data models. It is important because using an admin interface it is the preferred way to edit, add and delete information. It is boring because it basically means you have to create two interfaces dealing with exactly the same data: the layout of the website that is shown to public and the interface for data administration. Flask-Admin is an addon for the Flask microframework that takes care of the boring part. With little effort, it lets you manage your web service’s data through a user-friendly interface.

    Read more
  • Serve a Flask application on a servers subdirectory Python Flask

    Lately I wanted to test a new application before deployment and wanted to make it accessible via a subdirectory of my blog url. It doesn't sound like a great deal but I had some difficulties to accomplish it. To make my life easier in future and to help others facing the same challenge I wrote this Howto.

    Read more
  • Flask Webserver Deployment - Part 4: Nginx Proxy Server Python Flask

    This is the final part of my tutorial on Flask Server Deployment. In the last section we configured our Gunicorn WSGI server and controlled it via Supervisor. In this section we will place our WSGI server behind a Proxy server.

    Content of this Tutorial

    Read more
  • Flask Webserver Deployment - Part 3: Gunicorn WSGI Server Python Flask

    This is Part 3 of my tutorial for Flask Webserver Deployment. In the last section we prepared our server for serving a Flask application. We created a small Flask test application and finally started up the Flask development server. In this part we will use a more production ready server called Gunicorn to run the application.

    Content of this Tutorial

    Read more
  • Flask Webserver Deployment - Part 2: Flask Development Server Python Flask

    This is Part 2 of my tutorial for Flask Webserver Deployment. In the last section we acquired our own personal Linux server. Now we want to get connected to it and run our first Flask Test Application.

    Content of this Tutorial

    Read more