code: def autodiscover():
      
      # Get permissions based on urlpatterns from urls.py
      url_conf = getattr(settings, 'ROOT_URLCONF', ())
      resolver = urlresolvers.get_resolver(url_conf)
      urlpatterns = resolver.url_patterns
      permissions = generate_permissions(urlpatterns)
      # Refresh permissions
      refresh_permissions(permissions)
docs: Autodiscover for urls.py