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
name: CI | |
on: [push] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: |
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
""" | |
Originaly code was taken from: http://djangosnippets.org/snippets/290/ | |
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) | |
""" | |
try: | |
import cProfile as profile |
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
# -*- coding: utf-8 -*- | |
# Based on https://gist.github.com/voldmar/1264102 | |
# and https://gist.github.com/runekaagaard/2eecf0a8367959dc634b7866694daf2c | |
import gc | |
import inspect | |
import weakref | |
from collections import defaultdict | |
from django.apps import apps |
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
""" | |
adminreverse from here http://djangosnippets.org/snippets/2032/ | |
changed for working with ForeignKeys | |
https://gist.github.com/ramusus/4343464 | |
""" | |
""" | |
reverseadmin | |
============ | |
Module that makes django admin handle OneToOneFields in a better way. |