update allowed hosts & clean code

This commit is contained in:
Chneemann 2024-08-19 15:31:36 +02:00
parent cfaa728e55
commit 6fce3f1775
3 changed files with 2 additions and 8 deletions

View file

@ -2,9 +2,7 @@ from .models import Video
from .tasks import convert_video_to_hls, create_thumbnails, delete_original_video from .tasks import convert_video_to_hls, create_thumbnails, delete_original_video
from django.dispatch import receiver from django.dispatch import receiver
from django.db.models.signals import post_save, post_delete from django.db.models.signals import post_save, post_delete
from django.conf import settings
import os import os
import django_rq
import shutil import shutil
@receiver(post_save, sender=Video) @receiver(post_save, sender=Video)

View file

@ -3,8 +3,6 @@ import subprocess
import ffmpeg import ffmpeg
import os import os
from django.conf import settings from django.conf import settings
from .models import Video
from django_rq import get_queue
def convert_video_to_hls(source, resolution, model_id): def convert_video_to_hls(source, resolution, model_id):
target_dir = os.path.join(os.path.dirname(source), str(model_id)) target_dir = os.path.join(os.path.dirname(source), str(model_id))

View file

@ -37,15 +37,13 @@ DEFAULT_FROM_EMAIL = 'noreply@videoflix.com'
ALLOWED_HOSTS = [ ALLOWED_HOSTS = [
'videoflix-django.andre-kempf.com', 'videoflix-django.andre-kempf.com',
'35.198.182.146', '45.157.177.172',
'34.65.133.166',
'localhost', 'localhost',
'127.0.0.1', '127.0.0.1',
] ]
CORS_ALLOWED_ORIGINS = [ CORS_ALLOWED_ORIGINS = [
'https://35.198.182.146', 'https://45.157.177.172',
'https://34.65.133.166',
'http://localhost:4200', 'http://localhost:4200',
'https://videoflix.andre-kempf.com', 'https://videoflix.andre-kempf.com',
] ]