LINK AZURE- https://protoseek.azurewebsites.net/
- django (Backend)
- django rest framework (API)
- Ajax
- html and css and js
- chartjs
- bootstrap
- static_ranges for video
- dj_static
- Smpt2go for mailing verifying EMAIL ADDRESS OF USER
- thumbnail generation using Canvas Check out the file link
eg- studens,teacher
Students can access Few urls
Teacher can access Few urls
User have to reg to become teacher url - link
Admin of the ORGANISATION will review the request ,This method is used because Most of school or college May not have ORGANISATION Email
- Fork or Clone the Repo
- Change it As per Your ORGANISATION 3.ADD YOUR SMPT2GO USERNAME AND PASSWORD -CLICK
- The Existing username and Password will be Changed soon
- CREATE YOUR SQLDB
- Add your email here here
- The mail will use this Email Address
- Buy your Domain name And Add it in allowed here
- Host your Django Project ON AWS OR DIGITAL OCEAN
- Don't Host on Heruko(Free) because Request TimeOut
- I have Still Hosted on Heruko (free) for now demo purpose
- You cannot upload file to it, because of Request TimeOut
- I recommend AWS HOSTING
cd ProTO
python manage.py runserver
- MakeMigration
python manage.py makemigrations
- Migrate DB
python manage.py migrate
- IF your making Changes in CSS OR JS (static files) and DEBUG IS FASLE then Run this Command
python manage.py collectstatic
- Also you can change Static root and Media root -STATIC URL ROOT MEDIA ROOT
- ACCOUNTS -DJAGNO User MODEL
- TEACHER APP
- TEACHERS TABLE primaryKey is Teacher
class TEACHER(models.Model):
teacher = models.OneToOneField(User, on_delete=models.CASCADE, primary_key=True)
is_active=models.BooleanField(default=False)
def __str__(self):
return "EMAIL: " + self.teacher.email + " | USERNAME: " + self.teacher.username
- TEACHERS CLASS ROOM USES OF F.K (ForeignKey) check out django doc ,PrimaryKey is ID eg(1,2,3,4,......100....)AutoField
class TeacherClassRoom(models.Model):
class Meta:
unique_together = (('teacher', 'classRoomName'))
teacher=models.ForeignKey(TEACHER,on_delete=models.CASCADE)
classRoomName=models.CharField(max_length=25)
class_url=models.CharField(max_length=2000,blank=True)
def __str__(self):
return str(self.id)
- Students in Class Table ,P.K IS ID for this Table
class StudentInClassRoom(models.Model):
class Meta:
unique_together = (('classId', 'student'))
classId=models.ForeignKey(TeacherClassRoom,on_delete=models.CASCADE,to_field='id')
student=models.ForeignKey(User,on_delete=models.CASCADE)
- EVENT (ASSIGNMENT) PK IS ID FOR IS TABLE TOO
class Event(models.Model):
class Meta:
unique_together = (('eventname', 'Room'))
eventname = models.CharField(max_length=50)
Room=models.ForeignKey(TeacherClassRoom,on_delete=models.CASCADE)
def __str__(self):
return "Room :"+self.Room.classRoomName+"| Event :"+self.eventname
- Till Now all the above table to linked togther with ForeignKey
- Video App
- videoUpload table PK is id for this table
class videoUpload(models.Model):
captions=models.CharField(max_length=100)
username=models.CharField(max_length=100)
date=models.DateField(default='2001-04-12')
EventName=models.CharField(max_length=50,default="")
thumbnail=models.TextField()
video=models.FileField(upload_to="videos/%y",validators=[file_size,FileExtensionValidator(allowed_extensions=['mp4','MOV','MKV'])])
url_64encoding=models.CharField(max_length=2048,default='/upload/videos/')
Total_marks=models.IntegerField(default=0)
EventID=models.CharField(max_length=100,default='welcome newbie')
def __str__(self):
return self.captions
def total_marks(self):
return self.Total_marks
- MarkUpload table PK is id for this table
class Marks(models.Model):
class Meta:
unique_together=(('videoId','moderator_email'))
videoId=models.CharField(max_length=250)
by_email=models.CharField(max_length=250)
marks=models.IntegerField(validators=[MinValueValidator(0)])
moderator_email=models.CharField(max_length=250)
video_link=models.CharField(max_length=100000)
date=models.DateField(default='2001-04-12')
EventName = models.CharField(max_length=50, default="")
verfiyed=models.BooleanField(default=False)
def __str__(self):
return "VideoID:" +self.video_link+" BY :"+self.moderator_email
- Since we are using AIP you must have serializers class for this app
- READ DJANGO DOC
from rest_framework import serializers
from .models import videoUpload, Marks
from django.apps import apps
Events=apps.get_model('Event','Event')
class MarksSerializer(serializers.ModelSerializer) :
class Meta:
model=Marks
#fields="__all__"
fields=('video_link','date','by_email','EventName','marks')
class videoUploadSerializer(serializers.ModelSerializer):
class Meta:
model= videoUpload
#fields="__all__"
fields=('url_64encoding','date','username',)
class videoUploadSerializerMark(serializers.ModelSerializer):
class Meta:
model= videoUpload
#fields="__all__"
fields=('url_64encoding','date','username','EventName')
class SubmitVideo(serializers.ModelSerializer) :
class Meta :
model=videoUpload
fields=('thumbnail','video','captions')
#extra_kwargs = {'username': {'required': False}}
class VDContent(serializers.ModelSerializer):
class Meta:
model= videoUpload
fields=('url_64encoding','thumbnail','captions','username','date','EventName')
class EventSerial(serializers.ModelSerializer):
class Meta:
model=Events
fields='__all__'
- LOGIN -LINK
- Activation mail 2.1. ADMIN MUST CHECK THIS FILED THEN ONLY The TEACHER IS VALIDATED or VERIFIED
3.TEACHER REG PAGE - link for you the message may be diffrent (like under admin review )
4 . CREATE CLASS AND SHARE THE CODE WITH STUDENTS link
5 . Only Teacher can see this Page HOMEPAGE FOR teacher
-
ON click any class you will get all students list ,event and create a event for the class -(event means assignments)
-
Teacher can get all stat ,about uploads and pending videos (link)[https://protoseek.herokuapp.com/teacher/info/]
-
for Students the HomePage is link
-
upload page link
-
Import Join class link