All posts in Pro Tip
In another of our "you can do that?!?" with uWSGI posts, today I'll show you how to use uWSGI to host multiple sites and properly route traffic based on the hostname ...
Read More
Serving Static Files with uWSGI
Serving Static Files with uWSGI
As noted in a previous post, uWSGI is a Swiss Army knife of functionality. One of its features is a built-in static file server.
When to Use ...
Read More
Let's Encrypt DNS Challenge
By Yann Malet
Let's Encrypt is a new certificate authority. It is a huge improvement over the manual complex process of acquiring and deploying an HTTPS server. The process is now:
Free
Automatic (no more ...
Read More
The uWSGI Swiss Army Knife
uWSGI is one of those interesting projects that keeps adding features with every new release without becoming totally bloated, slow, and/or unstable. In this post, we'll look at some of its ...
Read More
Smarter Input Groups with Flexbox
If you have ever built a form using Bootstrap you have undoubtedly worked with input groups. Input groups are an excellent way to provide contextual help via iconography or associate specific actions ...
Read More
Rate Limiting with Nginx
Do you manage a website? Does it have a login form? Can somebody brute force attack it with every common username/password combination until they find one that works?
For many small ...
Read More
Varnish Saint Mode
By Yann Malet
Varnish Saint Mode is a lesser known gem inside varnish that lets you serve stale content from cache, even when your backend servers are unavailable.
This article explains how to configure varnish ...
Read More
Installing Node.js and npm into a Python Virtualenv
By Marco Louro
With things like LESS and RequireJS, we're starting to use Node.js's npm (think pip for JavaScript) on every other project. However, installing Node.js globally means some dependencies are also installed ...
Read More
tmux: Stay focused
By Graham King
On the surface tmux manages your terminal windows, but really it helps you stay focused. The challenge with learning tmux is that the benefits are not immediately apparent. At first it's just ...
Read More
The Joy of Upstart
By Graham King
Upstart is a ridiculously easy way to turn your scripts into daemons. Take this python script:
/home/myuser/ez_daemon.py:
import time
while 1:
print("I'm a daemon!")
time.sleep(1 ...
Read More
Realtime Replay Logs with Redis
First off, realtime websites are hard. The current toolset is rudimentary. When I first started building Ginger, I thought I must be doing it wrong because of all the trial-and-error and pieces ...
Read More
Quick Django Class Based View Decorator
By Vláďa Macek
The recommended way to add decorators such as login_required to class based views in Django is a bit verbose. Here’s a little metaclass-producing function you may find handy:
def DecoratedDispatchMethod(actual_decorator ...
Read More
Detecting File Moves & Renames with Rsync
By Vláďa Macek
Without patching, the rsync utility lacks support to detect when a file was renamed/moved across multiple directories inside the synced tree. There is a ––fuzzy option to save bandwidth by building ...
Read More
Filtering Results from Coverage.py
Coverage.py makes it easy to see how much of your code is covered by your test suite. It can be configured to spit out reports in XML (for consumption by a ...
Read More
Automated (No Prompt) Deployment with Pip
We love pip and Fabric for Django deployment. You can see our boilerplate fabfile.py here. Pip, however, isn’t safe to run in an automated fashion. If you attempt to switch ...
Read More
Automatically Running Supervisord on Startup
I really like supervisord for long-running process management. It is Python, so it is easy to install and it is easy to script with tools like Fabric. Lately I’ve been deploying ...
Read More
Pro Tip: Redirecting to a Custom Nginx Maintenance Page
Here’s one I struggled with a bit while upgrading lincolnloop.com yesterday.
Scenario: You need to take your site offline and want to redirect all its traffic to a “down for ...
Read More