IT FINALLY CLICKED, added logic behind uploads

This commit is contained in:
Yamozha
2021-02-05 03:18:16 +02:00
parent b3195368ee
commit 348a0a09bc
17 changed files with 147 additions and 7 deletions

View File

@ -1,3 +1,40 @@
from django.shortcuts import render
from django.shortcuts import render, redirect
# Create your views here.
from .models import upload_video,upload_image
def imageUpload(request):
if request.method == "GET":
return render(request, "uploadImage.html")
elif request.method == "POST":
image = request.POST["image"]
# add the id of the user, after you add in users
return upload_image(image)
else:
return
def videoUpload(request):
if request.method == "GET":
return render(request, "uploadVideo.html")
elif request.method == "POST":
video = request.POST["video"]
# add the id of the user, after you add in users
return upload_video(video)
else:
return
def upload_content(request):
if request.method == "GET":
return render(request, "index.html")
elif request.method == "POST":
choice = request.POST["choices"]
if choice == "image":
return redirect("/upload_image/")
elif choice == "video":
return redirect("/upload_video/")
else:
return
else:
return
# in conclusion - im genious, good job boyan lmao