diff options
-rw-r--r-- | fossee_anime/settings.py | 12 | ||||
-rw-r--r-- | fossee_manim/models.py | 16 | ||||
-rw-r--r-- | fossee_manim/templates/fossee_manim/index.html | 50 |
3 files changed, 47 insertions, 31 deletions
diff --git a/fossee_anime/settings.py b/fossee_anime/settings.py index 53b200b..9b3d6ed 100644 --- a/fossee_anime/settings.py +++ b/fossee_anime/settings.py @@ -12,7 +12,7 @@ https://docs.djangoproject.com/en/1.9/ref/settings/ import os import sys -from local_settings import ( +from .local_settings import ( EMAIL_HOST, EMAIL_PORT, EMAIL_HOST_USER, @@ -77,6 +77,8 @@ TEMPLATES = [ 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', + 'django.template.context_processors.media', + ], }, }, @@ -140,11 +142,11 @@ LOGIN_URL = '/login/' MEDIA_URL = '/data/' -MEDIA_ROOT = os.path.join(BASE_DIR, "workshop_app", "data") +MEDIA_ROOT = os.path.join(BASE_DIR, "fossee_manim", 'data') -LOG_FOLDER = os.path.join(BASE_DIR, "workshop_app", "logs") +LOG_FOLDER = os.path.join(BASE_DIR, "fossee_manim", "logs") -#Email Connection Settings +# Email Connection Settings EMAIL_HOST = EMAIL_HOST EMAIL_HOST_USER = EMAIL_HOST_USER EMAIL_HOST_PASSWORD = EMAIL_HOST_PASSWORD @@ -155,7 +157,7 @@ SENDER_EMAIL = SENDER_EMAIL EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' -#Change this to the production url +# Change this to the production url PRODUCTION_URL = 'your_production_url' ADMIN_EMAIL = 'your admin email'
\ No newline at end of file diff --git a/fossee_manim/models.py b/fossee_manim/models.py index 9a85c4d..a3b3537 100644 --- a/fossee_manim/models.py +++ b/fossee_manim/models.py @@ -209,4 +209,18 @@ class AnimationStats(models.Model): # Converting to Python file object with # some Django-specific additions django_file = File(que_file) - self.thumbnail.save(file_name, django_file, save=True)
\ No newline at end of file + self.thumbnail.save(file_name, django_file, save=True) + + def _create_ogv(self): + video_input = self.video_path.path + vid_output = path.join( + tempfile.mkdtemp(), "{0}.ogv".format(self.animation.title) + ) + file_name = "{0}.ogv".format(self.animation.title) + subprocess.call(['ffmpeg', '-i', video_input, '-r', '24', vid_output]) + if path.exists(vid_output): + que_file = open(vid_output, 'rb') + # Converting to Python file object with + # some Django-specific additions + django_file = File(que_file) + self.video_path.save(file_name, django_file, save=True)
\ No newline at end of file diff --git a/fossee_manim/templates/fossee_manim/index.html b/fossee_manim/templates/fossee_manim/index.html index 3d39b41..0753918 100644 --- a/fossee_manim/templates/fossee_manim/index.html +++ b/fossee_manim/templates/fossee_manim/index.html @@ -4,12 +4,11 @@ <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="Akshen Doke" content="PRE, FOSSEE-IITB"> - <meta name="title" content="Welcome to FOSSEE's Python Workshops"> + <meta name="title" content="Welcome to FOSSEE's Animation for Education"> <meta name="description" content="The FOSSEE team at IIT Bombay conducts remote-assisted training programs in Python. These are interactive workshop sessions with hands-on experience, live assistance, practice sessions and evaluation quizzes. - These programs can be conducted at your institution / organisation, free of charge. - Please note that you will require a coordinator and a minimum number of 25 participants to request for these workshops."> - <meta name="keywords" content="learn python for free, fossee, iit bombay, python workshops, fossee python, python workshops"> + These programs can be conducted at your institution / organisation, free of charge."> + <meta name="keywords" content="fossee, iit bombay, animation based learning math, manim, python based animations"> <!-- favicon --> <link rel="shortcut icon" type="image/png" href="{{ URL_ROOT}}/static/img/fevicon_python.png"/> @@ -37,22 +36,23 @@ <div class="container-fluid" style="height:100%; background-color: #3D5A50;"> <div class="row" id="r1" style="background-color:#ffffff"> <div class="col-md-2" id="brand"><strong>FOSSEE</strong> <br>Animation</div> - <div class="col-md-10" style="text-align:center;" id="tag"><strong>Python based animation for math</strong></div> + <div class="col-md-10" style="text-align:center;" id="tag"><strong>Animation based learning</strong></div> </div> <div class="row" id="r2" style="background-color:#3D5A50"> <div class="col-md-8"> - <form class="example" action="" id="search_bar"> - <input type="text" placeholder="Search." name="search" id="search_tab"> + <form class="example" id="search_bar" method="POST" action="/search/"> + {% csrf_token %} + <input type="text" id="sbox" name="sbox" type="search" placeholder="Search" id="search_tab"> <button type="submit"><i class="fa fa-search"></i></button> </form> </div> <div class="col-md-2" id="btns" style="text-align:center;"> - <a href="{{URL_ROOT}}/login"><strong>Login</strong></a> + <a href="{% url 'login' %}"><strong>Login</strong></a> </div> <div class="col-md-2" id="btns" style="text-align:center;"> - <a href="{{URL_ROOT}}/register"><strong>Register</strong></a> + <a href="{% url 'register' %}"><strong>Register</strong></a> </div> </div> @@ -71,28 +71,28 @@ <div class="row" id="r4" style="background-color:ghostwhite"> <hr style="height:3px;"> <div class="col-md-3" style="text-align:center;"> - <iframe width="240" height="125" - src="https://www.youtube.com/embed/JGLfa66Os0Q" frameborder="0" allow="accelerometer; - encrypted-media; gyroscope; picture-in-picture" allowfullscreen> - </iframe> + <a href="{% url 'video' anime.0.id %}" > + <span class="fa fa-play fa-4x" id="play-btn"></span> + <img height="25%" width="65%" src="{{ anime.0.thumbnail.url }}"> + </a> </div> <div class="col-md-3" style="text-align:center;"> - <iframe width="240" height="125" - src="https://www.youtube.com/embed/JGLfa66Os0Q" frameborder="0" allow="accelerometer; - encrypted-media; gyroscope; picture-in-picture" allowfullscreen> - </iframe> + <a href="{% url 'video' anime.1.id %}" > + <span class="fa fa-play fa-4x" id="play-btn"></span> + <img height="25%" width="65%" src="{{ anime.1.thumbnail.url }}"> + </a> </div> <div class="col-md-3" style="text-align:center;"> - <iframe width="240" height="125" - src="https://www.youtube.com/embed/JGLfa66Os0Q" frameborder="0" allow="accelerometer; - encrypted-media; gyroscope; picture-in-picture" allowfullscreen> - </iframe> + <a href="{% url 'video' anime.2.id %}" > + <span class="fa fa-play fa-4x" id="play-btn"></span> + <img height="25%" width="65%" src="{{ anime.2.thumbnail.url }}"> + </a> </div> <div class="col-md-3" style="text-align:center;"> - <iframe width="240" height="125" - src="https://www.youtube.com/embed/JGLfa66Os0Q" frameborder="0" allow="accelerometer; - encrypted-media; gyroscope; picture-in-picture" allowfullscreen> - </iframe> + <a href="{% url 'video' anime.3.id %}" > + <span class="fa fa-play fa-4x" id="play-btn"></span> + <img height="25%" width="65%" src="{{ anime.3.thumbnail.url }}"> + </a> </div> </div> |