diff options
-rw-r--r-- | app/media/models.py | 9 | ||||
-rw-r--r-- | app/posts/templates/posts/film_detail.html | 8 |
2 files changed, 13 insertions, 4 deletions
diff --git a/app/media/models.py b/app/media/models.py index c93b9fc..64f427a 100644 --- a/app/media/models.py +++ b/app/media/models.py @@ -5,6 +5,7 @@ from pathlib import Path from PIL import Image from django.core.exceptions import ValidationError +from django.core.files import File from django.contrib.gis.db import models from django.contrib.sitemaps import Sitemap from django.db.models.signals import post_save @@ -26,17 +27,17 @@ from .utils import resize_image from locations.models import Location, CheckIn -def add_mp4(self, filepath, luxvideo): +def add_mp4(filepath, luxvideo): full_filepath = "/home/lxf/sites/django/luxagraf.net/"+filepath - v = open(filepath, "rb") + v = open(full_filepath, "rb") django_file = File(v) video = LuxVideo.objects.get(title=luxvideo) video.video_mp4.save(filepath, django_file, save=True) -def add_webm(self, filepath, luxvideo): +def add_webm(filepath, luxvideo): full_filepath = "/home/lxf/sites/django/luxagraf.net/"+filepath - v = open(filepath, "rb") + v = open(full_filepath, "rb") django_file = File(v) video = LuxVideo.objects.get(title=luxvideo) video.video_webm.save(filepath, django_file, save=True) diff --git a/app/posts/templates/posts/film_detail.html b/app/posts/templates/posts/film_detail.html index 390eb3c..19c55a0 100644 --- a/app/posts/templates/posts/film_detail.html +++ b/app/posts/templates/posts/film_detail.html @@ -2,6 +2,14 @@ {% load typogrify_tags %} {% load get_image_by_size %} {%block htmlclass%}{%endblock%} +{% block extrahead %} +<style> +.video { + aspect-ratio: 16 / 9; + width: 100%; +} +</style> +{% endblock%} {% block sitename %} <head itemscope itemtype="http://schema.org/WebSite"> <title itemprop='name'>{{object.title|safe}} by Scott Gilbertson</title> |