Skip to content

Instantly share code, notes, and snippets.

View Psycojoker's full-sized avatar
💭
I'm really busy right now, I can take weeks to answer.

Bram Psycojoker

💭
I'm really busy right now, I can take weeks to answer.
View GitHub Profile
@wolph
wolph / tox_ini_to_toml.py
Last active March 6, 2026 13:28
Convert a tox.ini to tox.toml or pyproject.toml file.
#!/usr/bin/env python3
import argparse
import configparser
import os
import re
import shlex
import sys
from typing import Any
from django.core.conf import settings
class DbgResponse(object):
def process_response(self, request, response):
"""Add html, head, and body tags so debug toolbar will activate."""
if request.GET.get('dbg') and settings.DEBUG:
cnt = response.content
if '<body>' not in cnt:
response.content = '<html><head></head><body>%s</body></html>' % cnt
if 'content_type' in response._headers: