If you see valid patterns in the file then the issue is probably caused by a circular import." raise an ImproperlyConfigured exception with an argument: return value of the method msg.format, called with an argument name set to self.urlconf_name.
raise ImproperlyConfigured ( msg . format ( name = self . urlconf_name ) )