from django.http.response import HttpResponse, HttpResponseRedirect from django.template import engines from django.contrib.auth import login as auth_login, get_user_model, authenticate from django.contrib.auth.views import LoginView, logout_then_login from django.contrib.auth.decorators import login_required from django.views import generic from django import template
import django from django import template register = template.Library()
@register.filter defget_dict(obj,way="",depth=0): if depth>11: return objdir=dir(obj) r={"dict":objdir,"way":way} result="" for i in objdir: try : if'_' == i[0]: continue ifgetattr(obj, '__module__', None)!=Noneandgetattr(obj, '__module__', None).split('.')[0] == django.__name__: result+=get_dict(getattr(obj,i,None),way+"."+i,depth+1) except TypeError: pass
if"SECRET_KEY"in objdir or"settings"in objdir: print(way) return result+way+"\n" return result