NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].
| from inspect import isclass | |
| from os.path import dirname, join | |
| import django | |
| import oyaml as yaml | |
| from django.conf import settings | |
| from django.core.exceptions import ViewDoesNotExist | |
| from django.core.management import BaseCommand | |
| from django.urls import URLPattern, URLResolver | |
| from rest_framework import serializers |
NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].