Skip to content

Instantly share code, notes, and snippets.

View Mischback's full-sized avatar

Mischback Mischback

View GitHub Profile
@Mischback
Mischback / django_sql_hack.rst
Last active May 13, 2018 12:48
A hackish way to see details of SQL queries

This is a small hack to include some details of SQL queries into an template.

Without installing something like 'django-debug-toolbar', this enables performance optimisations.

# apply these to the settings module
INTERNAL_IPS = ['your IP here']

# add this to the TEMPLATES context_processors
$TTL 1w ; default TTL = 1w
; TODO: should be adjusted to frequency of list updates
@ IN SOA localhost. root.localhost. (
2019102401 ; serial yyyymmddvv
1w ; refresh (match default TTL)
1w ; retry (match default TTL)
1w ; expiry (match default TTL)
1d ; negative caching
)
#!/usr/bin/env python3
# -*- utf-8 -*-
# Python imports
from argparse import ArgumentParser
import logging
from logging.handlers import SysLogHandler
import os
import sys
import yaml
@Mischback
Mischback / outline.txt
Created January 10, 2020 11:55
Requirements for the django-project-skeleton
1) Wofür soll das Repo eingesetzt werden?
Das Repo dient als Template zur Erstellung eines Django-Projektes. Es muss daher alle notwendigen Funktionalitäten enthalten, ein Django-Projekt zu verwalten. Dies beinhaltet u.a.
- Verwaltung der Projekteinstellungen (settings) inkl. vernünftiger Default-Werte
- Nutzung von (pluggable) Django-Apps, sowohl installiert in site-packages als auch in direkter Source-Code-Variante
- Verwaltung von requirements (development/production) für Python-Pakete
- Ausführen aller notwendigen Test-Suites der einzelnen Apps
- ggf. die Möglichkeit zur Implementierung eigener Tests, die projektspezifisch sind
- Ausführen des Projektes zur Entwicklung (also mit development settings)
- Ausführen des Projektes zum Staging (also schon mit production settings)
- Deployment des Projektes bestmöglich vorbereiten
# Collection of input and code samples to make django-project-skeleton run on Docker
@Mischback
Mischback / dps.md
Created February 18, 2020 21:37
django-project-skeleton - Ressources

This gist contains documentation, code snippets and some more stuff regarding django-project-skeleton

@Mischback
Mischback / keyboard_stuff.md
Created January 17, 2023 20:30
Keyboard Stuff