Skip to content

Instantly share code, notes, and snippets.

@feanil
feanil / get_all_views.py
Last active August 30, 2023 15:19 — forked from Gautamaggrawal/get_all_views.py
GET ALL VIEWS IN DJANGO APP
from django.conf import settings
from django.urls import URLResolver, URLPattern
root_urlconf = __import__(settings.ROOT_URLCONF) # import root_urlconf module
all_urlpatterns = root_urlconf.urls.urlpatterns # project's urlpatterns
def get_all_view_names(urlpatterns):
views = []
for pattern in urlpatterns:
if isinstance(pattern, URLResolver):
@feanil
feanil / how-i-work-template.md
Created June 14, 2021 14:28 — forked from jazzsequence/how-i-work-template.md
Template for How I Like to Work posts

How I work

This is my own interpretation of how I like to work, feedback welcome! Especially if my own view of how I think I like to work doesn't match your experience of how it seems I like to work!

When I work