django admin registration

models.py Tests for various ways of registering models with the admin site. from django.db import models

django admin filters

models.py from django.contrib.auth.models import User from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation from django.contrib.contenttypes.models import ContentType from django.db import models

django admin custom urls

models.py from functools import update_wrapper from django.contrib import admin from django.db import models from django.http import HttpResponseRedirect from django.urls import reverse

django admin autodiscover

admin.py from django.contrib import admin from .models import Story admin.site.register(Story) raise Exception("Bad admin module") models.py  from django.db import models

django absolute url overrides

from django.db import models from django.test import SimpleTestCase from django.test.utils import isolate_apps

Silk is a live profiling and inspection tool for the Django framework

Quick Start Silk is installed like any other Django app. First install via pip: pip install django-silk Add the following to your settings.py: MIDDLEWARE = [ ... 'silk.middleware.SilkyMiddleware', ... ] INSTALLED_APPS = [ ... 'silk

django Werkzeug debugge

RunServerPlus-typical runserver with Werkzeug debugger baked in

django validate templates

class MyTests(unittest.TestCase): def test_validate_templates(self): call_command("validate_templates") # This throws an error if it fails to validate

django Validators

Installing $ pip install django-extensions Current Database Model Field Extensions NoControlCharactersValidator

Django Jobs Scheduling

Installing $ pip install django-extensions Jobs Scheduling synopsis: Documentation on creating/using jobs in Django-extensions Creating jobs works much like management commands work in Django