Skip to content

Instantly share code, notes, and snippets.

emorozov / python-django-postgres-ci.yml
Created May 10, 2020 08:08 — forked from jefftriplett/python-django-postgres-ci.yml
This is a good starting point for getting Python, Django, Postgres running as a service, pytest, black, and pip caching rolling with GitHub Actions.
name: CI
on: [push]
runs-on: ubuntu-latest
Originaly code was taken from:
But I was made some improvements like:
- print URL from what queries was
- don't show queries from static URLs (MEDIA_URL and STATIC_URL, also for /favicon.ico).
- If DEBUG is False tell to django to not use this middleware
- Remove guessing of terminal width (This breaks the rendered SQL)
import cProfile as profile
emorozov /
Last active May 10, 2020 07:51 — forked from runekaagaard/
List all signals by model and signal type. Tested with Django 3.
# -*- coding: utf-8 -*-
# Based on
# and
import gc
import inspect
import weakref
from collections import defaultdict
from django.apps import apps
emorozov / gist:6688436
Last active December 23, 2015 20:19 — forked from ramusus/gist:4343464
Updated for compatibility with Django 1.5.4. Reformatted for PEP-8 compliance.
adminreverse from here
changed for working with ForeignKeys
Module that makes django admin handle OneToOneFields in a better way.