This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
from django.utils.text import compress_string | |
from django.utils.cache import patch_vary_headers | |
from django import http | |
''' | |
EXAMPLE USAGE: | |
Put this file in a directory called, eg, 'middleware,' inside your django |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Set terminal tab / decoration color by the server name. | |
Get a random colour which matches the server name and use it for the tab colour: | |
the benefit is that each server gets a distinct color which you do not need | |
to configure beforehand. | |
""" |