<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _try_url_with_appended_slash(self):
 """ Try our URL with an appended slash. If a CMS page is found at that URL, redirect to it. If no page is found at that URL, raise Http404. """

        new_url_to_try = self.kwargs.get('path', '') + '/'
        if not new_url_to_try.startswith('/'):
            new_url_to_try = '/' + new_url_to_try
        if CMSPage.objects.published().filter(url=new_url_to_try).exists():
            return HttpResponsePermanentRedirect(new_url_to_try)
        else:
            raise Http404