コード例 #1
0
 def handle_noargs(self, **options):
     if getattr(settings, 'CKEDITOR_IMAGE_BACKEND', None):
         backend = get_backend()
         for image in get_image_files():
             if not self._thumbnail_exists(image):
                 self.stdout.write("Creating thumbnail for %s" % image)
                 try:
                     backend.create_thumbnail(image)
                 except Exception as e:
                     self.stdout.write("Couldn't create thumbnail for %s: %s" % (image, e))
         self.stdout.write("Finished")
     else:
         self.stdout.write("No thumbnail backend is enabled")
コード例 #2
0
 def handle(self, *args, **options):
     if getattr(settings, 'CKEDITOR_IMAGE_BACKEND', None):
         backend = get_backend()
         for image in get_image_files():
             if not self._thumbnail_exists(image):
                 self.stdout.write("Creating thumbnail for %s" % image)
                 try:
                     backend.create_thumbnail(image)
                 except Exception as e:
                     self.stdout.write("Couldn't create thumbnail for %s: %s" % (image, e))
         self.stdout.write("Finished")
     else:
         self.stdout.write("No thumbnail backend is enabled")