File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 1- web : gunicorn --bind=0.0.0.0:8000 --workers=4 --timeout 120 --forwarded-allow-ips=* infographics.wsgi:application
1+ web : gunicorn --bind=0.0.0.0:8000 --workers=4 --timeout 120 --log-level debug -- forwarded-allow-ips=* infographics.wsgi:application
22migrate : python manage.py migrate
Original file line number Diff line number Diff line change @@ -28,6 +28,9 @@ class Video(models.Model):
2828 )
2929 file_framerate = models .PositiveIntegerField (blank = True , null = True )
3030
31+ def __str__ (self ):
32+ return f"video { self .id } "
33+
3134 def generate_video (self , framerate : int ):
3235 """
3336 Generates the video using the png frames.
@@ -48,7 +51,7 @@ def generate_video(self, framerate: int):
4851 shutil .copy (frame .png .path , os .path .join (dir , f"{ istr } .png" ))
4952 input = os .path .join (dir , "%06d.png" )
5053 output = os .path .join (dir , "output.webm" )
51- logger .info (f"[{ self . id } ] generating..." )
54+ logger .info (f"[{ self } ] generating..." )
5255 subprocess .run (
5356 [
5457 "ffmpeg" ,
@@ -67,7 +70,7 @@ def generate_video(self, framerate: int):
6770 check = True ,
6871 capture_output = True ,
6972 )
70- logger .info (f"[{ self . id } ] generated file" )
73+ logger .info (f"[{ self } ] generated file" )
7174 self .file_framerate = framerate
7275 with open (output , "rb" ) as f :
7376 self .file .save (f"video-{ self .id } .webm" , f )
You can’t perform that action at this time.
0 commit comments