diff --git a/Media/user_upload/compressed/Avengers.jpg b/Media/user_upload/compressed/Avengers.jpg new file mode 100644 index 0000000..353bb18 Binary files /dev/null and b/Media/user_upload/compressed/Avengers.jpg differ diff --git a/Media/user_upload/compressed/Inception.jpg b/Media/user_upload/compressed/Inception.jpg new file mode 100644 index 0000000..a57763a Binary files /dev/null and b/Media/user_upload/compressed/Inception.jpg differ diff --git a/Media/user_upload/full_quality/Avengers.jpg b/Media/user_upload/full_quality/Avengers.jpg new file mode 100644 index 0000000..9003b6e Binary files /dev/null and b/Media/user_upload/full_quality/Avengers.jpg differ diff --git a/Media/user_upload/full_quality/Inception.jpg b/Media/user_upload/full_quality/Inception.jpg new file mode 100644 index 0000000..6ca53fe Binary files /dev/null and b/Media/user_upload/full_quality/Inception.jpg differ diff --git a/db.sqlite3 b/db.sqlite3 index d722dd1..2a81980 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ diff --git a/home/models.py b/home/models.py index f8e5b09..1aaacb2 100644 --- a/home/models.py +++ b/home/models.py @@ -3,6 +3,8 @@ from django.db import models from PIL import Image from io import BytesIO + + # Create your models here. # user uploads mode (includes title, image, tags) diff --git a/home/urls.py b/home/urls.py index 35d6385..f1a558d 100644 --- a/home/urls.py +++ b/home/urls.py @@ -8,4 +8,6 @@ path("upload_view/", views.upload_view, name="upload_view"), path("about_us/", views.about, name="about_us"), path("contact_us", views.contact, name="contact_us"), + path("photography/", views.photography, name="photography"), + path("illustration/", views.illustration, name="illustration"), ] diff --git a/home/views.py b/home/views.py index feb98b8..4271813 100644 --- a/home/views.py +++ b/home/views.py @@ -1,6 +1,6 @@ from django.shortcuts import render, redirect from .forms import ImageForm, ImageFormURL - +from .models import UserUpload, UserUploadURL # Create your views here. @@ -44,3 +44,15 @@ def url_upload(request): # page for users to upload images else: # if invalid print errors form = ImageForm() return redirect("upload_view") # return to form view + + +def photography(request): + # Filter through images based on tag and privacy + filtered_images = UserUpload.objects.filter(tags='option_two', privacy='option_one') + return render(request, 'photography.html', {'images': filtered_images}) + + +def illustration(request): + # Filter through images based on tag and privacy + filtered_images = UserUpload.objects.filter(tags='option_three', privacy='option_one') + return render(request, 'illustration.html', {'images': filtered_images}) diff --git a/templates/home.html b/templates/home.html index b56fe7d..916b9e6 100644 --- a/templates/home.html +++ b/templates/home.html @@ -15,10 +15,10 @@