41 lines
1.1 KiB
Python
41 lines
1.1 KiB
Python
from django.shortcuts import render, redirect
|
|
|
|
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
|