trxdave / photography-blog

1 stars 1 forks source link

Photography Blog

Introduction

Photography Blog is a dynamic web application created for photography enthusiasts who wish to showcase their work and connect with a community of like-minded individuals. This platform allows users to upload their photos, categorize them, and engage with others through comments and likes. Whether you’re an amateur photographer or a seasoned professional, the Photography Blog offers a space to share your visual stories with the world.

View the live project here: Photography Blog

GitHub commit activity GitHub last commit GitHub repo size

Am I Responsive

Here's deployed site: Am I Responsive

alt text

Project Overview

Photography Blog is a web application designed for photographers to share their work with a community. Users can upload photos, categorize them, leave comments, and interact with others by liking photos. The project emphasizes a user-friendly interface with responsive design, making it accessible on both desktop and mobile devices.

Developer Goals

The primary goals for the development of the Photography Blog are:

  1. Create an Intuitive User Interface: Develop a user-friendly and responsive interface that allows users to easily navigate the site, upload photos, and interact with other users.
  2. Implement Robust User Authentication: Ensure that user data is securely handled with proper authentication mechanisms, allowing users to manage their profiles and content.
  3. Enable Content Management: Provide users with the ability to upload, edit, and delete their photos, as well as categorize them for better organization and discovery.
  4. Foster Community Interaction: Encourage user engagement through features like comments and likes, creating a social environment around photography.
  5. Ensure Mobile Responsiveness: Design the site to be fully responsive, ensuring a seamless experience on devices of all sizes, from desktops to smartphones.
  6. Utilize Cloud Storage for Media: Integrate cloud storage solutions to efficiently manage and serve images, optimizing performance and scalability.
  7. Provide Comprehensive Error Handling: Implement custom error pages to handle common HTTP errors gracefully, improving the user experience even when things go wrong.

User Goals

For users, the Photography Blog aims to fulfill the following goals:

  1. Easily Share Photography: Users should be able to effortlessly upload and categorize their photos, making them accessible to others.
  2. Engage with the Community: Users should be able to interact with other photographers through comments and likes, building a sense of community.
  3. Explore a Wide Range of Photography: The platform should provide an easy way to browse and discover photos across different categories, helping users to find inspiration and new connections.
  4. Manage Personal Content: Users should have control over their own content, with the ability to edit or delete their photos and manage their profile settings.
  5. Access from Any Device: Users should enjoy a consistent and intuitive experience across all devices, whether they are on a desktop or mobile device.
  6. Search for Specific Content: The platform should offer a search feature that allows users to quickly find photos or posts that match their interests.
  7. Secure and Private Experience: Users should feel confident that their personal information is secure, and that they have privacy controls over their content.

Problem Statement

Background

Photography is a powerful medium for storytelling, yet existing platforms often fail to provide photographers with the tailored experience they need. General social media sites overwhelm quality content with sheer volume, making it difficult for photographers to stand out and connect meaningfully with their audience.

Problem

Photographers face several challenges on current platforms:

Requirements

To address these challenges, the Photography Blog must:

Target Audience

This platform is designed for:

Entity-Relationship Diagram (ERD)

The Entity-Relationship Diagram (ERD) representing the relationships between the User, Category, Photo and Comment models.

alt text

Learning Outcomes

  1. Django Framework Proficiency:

  1. Bootstrap Integration:

  1. Python Programming Skills:

  1. Image Handling with Pillow and Cloudinary:

  1. CRUD Operations:

  1. User Authentication and Authorization:

  1. Template Rendering and Static Files Management:

  1. Javascript Integration and Engancement

    • Develop JavaScript skills to enhance interactivity and user experience in Django applications.
    • Learn to write custom JavaScript code for dynamic features such as search bars, toggle and dropdown.

User Experience (UX)

The goal of this project is to create a seamless and enjoyable user experience for amateur photographers. The blog is designed to be intuitive, visually appealing, and functional, ensuring users can easily navigate the site, upload their work, and engage with the community.

User Stories

  1. As a Site User I can view a paginated list of posts so that easily select a post to view.
  2. As a Site User / Admin I can view the number of likes on each post so that I can see which is the most popular or viral.
  3. As a Site User, I want to log in, so that I can access my account and manage my posts.
  4. As a Site User, I want to upload photos, so that I can share my work with others.
  5. As a Site User, I want to edit or delete my posts, so that I can manage my portfolio.
  6. As a Site User, I want to comment on posts, so that I can provide feedback and engage with the community.
  7. As a Site User, I want to log out, so that I can securely leave the site.

and more. Link to the Kanban board here

Development Plan

This project was organized and executed using Agile methodology. A Kanban board within GitHub Projects was utilized to track progress and manage tasks, ensuring a structured and iterative development process. Link to the Kanban board here

alt text

Features

User Authentication

Photo Management

Comments

Search Functionality

Pagination

Responsive Design

Error Handling

Model Design

Design

The design of the Photography Blog is modern and minimalist, with a focus on showcasing high-quality images. The layout is clean and simple, with ample whitespace to create a visually appealing experience for users. The color scheme is a combination of neutral tones, with accents of blue to evoke a sense of creativity and inspiration.

base.html

alt text

alt text

alt text

alt text

blog.html

alt text alt text

Category Pages: Landscape, Portrait, Wildlife, Street, Macro

landscape.html -

alt text

portrait.html -

alt text

wildlife.html -

alt text

street.html -

alt text

macro.html -

alt text

Add Photo Page -

alt text

Success Page The success.html page is a dedicated confirmation page displayed after a user successfully uploads a photo to their portfolio. The page is designed with user experience in mind, featuring a clean and centered card that conveys the success message. The card header, styled in green, signals the successful upload with the message "Photo Uploaded Successfully!" Users are informed that their photo is now visible in their portfolio. Additionally, the page provides easy navigation with buttons allowing users to either view their photos or upload another one.

Key Features:

alt text

alt text

My Photo List Page

This page serves as a personal management tool, giving users full control over their uploaded content on the Photography Blog. It encourages users to maintain and curate their gallery, contributing to the overall quality and organization of the site.

alt text alt text alt text

View Page

The View Page displays detailed information about a specific photo, including its title, description, and the photographer's username. Key features include:

alt text alt text

Edit Page

The Edit Page allows users to modify the details of their uploaded photos. Key features include:

alt text

Delete Photo

The Delete Page allows users to permanently remove their uploaded photos. Key features include:

alt text alt text

About Us

The About Us page provides visitors with insights into the mission and vision of the Photography Blog. Key elements include:

alt text alt text

Contact Us

The Contact Us page is designed to facilitate communication between visitors and the Photography Blog team. Key features include:

alt text

Sign Up

The Sign Up page allows new users to create an account on the Photography Blog. It includes a simple and user-friendly form where users can enter their desired username, email, and password. Upon successful registration, users are automatically logged in and redirected to the homepage. A success message is displayed to welcome the new user.

alt text

Login

The Login page provides a secure way for returning users to access their accounts on the Photography Blog. The page features a straightforward form where users can enter their username and password. After a successful login, users are redirected to the homepage.

alt text

Error Page

The Photography Blog includes custom error pages to enhance user experience when something goes wrong. These pages ensure that even in the case of errors, users receive clear and helpful feedback. The custom error pages include:

400 Bad Request 403 Forbidden 404 Not Found 500 Internal Server Error

Design Choices

The design choices were influenced by the need to create a platform that is easy to navigate and visually appealing. The use of a minimalist layout and neutral color scheme allows the focus to be on the photography, while the accents of blue add a touch of personality to the design.

Colours

The colors used in the design are:

alt text

Fonts

The fonts used in your project are:

Arial, sans-serif: This is the main font used throughout your CSS for body text and headings. It's a widely used, clean, and highly readable font that is supported across all browsers and devices.

Wireframes

Desktop Wireframes

Page Wireframes Pass
About Us
Screenshot of resultResult
:white_check_mark:
Add Photo
Screenshot of resultResult
:white_check_mark:
Blog
Screenshot of resultResult
:white_check_mark:
Contact Us
Screenshot of resultResult
:white_check_mark:
Homepage
Screenshot of resultResult
:white_check_mark:
Landscape
Screenshot of resultResult
:white_check_mark:
Login
Screenshot of resultResult
:white_check_mark:
Macro
Screenshot of resultResult
:white_check_mark:
Photo List
Screenshot of resultResult
:white_check_mark:
Portrait
Screenshot of resultResult
:white_check_mark:
Sign Up
Screenshot of resultResult
:white_check_mark:
Street
Screenshot of resultResult
:white_check_mark:
Wildlife
Screenshot of resultResult
:white_check_mark:
Success
Screenshot of resultResult
:white_check_mark:

Mobile Wireframes

Page Wireframes Pass
About Us
Screenshot of resultResult
:white_check_mark:
Add Photo
Screenshot of resultResult
:white_check_mark:
Blog
Screenshot of resultResult
:white_check_mark:
Contact Us
Screenshot of resultResult
:white_check_mark:
Homepage
Screenshot of resultResult
:white_check_mark:
Landscape
Screenshot of resultResult
:white_check_mark:
Login
Screenshot of resultResult
:white_check_mark:
Macro
Screenshot of resultResult
:white_check_mark:
Photo List
Screenshot of resultResult
:white_check_mark:
Portrait
Screenshot of resultResult
:white_check_mark:
Sign Up
Screenshot of resultResult
:white_check_mark:
Street
Screenshot of resultResult
:white_check_mark:
Wildlife
Screenshot of resultResult
:white_check_mark:
Success
Screenshot of resultResult
:white_check_mark:

Testing

Validator Testing

HTML Validation

ll pages were validated, and the code was pasted in. A filter was applied to remove issues related to the Django templating system.

Tested Result View Result Pass
base No errors
Screenshot of resultResult
:white_check_mark:
about No errors
Screenshot of resultResult
:white_check_mark:
add photo No errors
Screenshot of resultResult
:white_check_mark:
blog No errors
Screenshot of resultResult
:white_check_mark:
confirm delete No errors
Screenshot of resultResult
:white_check_mark:
contact No errors
Screenshot of resultResult
:white_check_mark:
edit photo No errors
Screenshot of resultResult
:white_check_mark:
homepage No errors
Screenshot of resultResult
:white_check_mark:
landscape No errors
Screenshot of resultResult
:white_check_mark:
marco No errors
Screenshot of resultResult
:white_check_mark:
photo detail No errors
Screenshot of resultResult Result
:white_check_mark:
photo list No errors
Screenshot of resultResult Result
:white_check_mark:
portrait No errors
Screenshot of resultResult
:white_check_mark:
search results No errors
Screenshot of resultResult
:white_check_mark:
street No errors
Screenshot of resultResult
:white_check_mark:
wildlife No errors
Screenshot of result![Result]() Result
:white_check_mark:

CSS Validation

Tested Result View Result Pass
styles.css No errors
Screenshot of resultResult
:white_check_mark:

Python linter (PEP8)

Tested Result View Result Pass
admin.py No errors
Screenshot of resultResult
:white_check_mark:
apps.py No errors
Screenshot of resultResult
:white_check_mark:
forms.py No errors
Screenshot of resultResult
:white_check_mark:
models.py No errors
Screenshot of resultResult
:white_check_mark:
url.py No errors
Screenshot of resultResult
:white_check_mark:
views.py No errors
Screenshot of resultResult
:white_check_mark:

JShint

Tested Result View Result Pass
script.js No errors
Screenshot of resultResult
:white_check_mark:

Accessibility

PageSpeed Insights Accessibility Results

I used Google PageSpeed Insights to evaluate the accessibility of our website on both mobile and desktop platforms. PageSpeed Insights provides a score out of 100 for accessibility, which measures how well the content of the web pages is accessible to all users, including those with disabilities.

Desktop Accessibility Scores

Tested Result View Result Pass
Homepages 89
Screenshot of resultResult
:white_check_mark:
Blog page 84
Screenshot of resultResult
:white_check_mark:
Landscape page 84
Screenshot of resultResult
:white_check_mark:
Portrait page 84
Screenshot of resultResult
:white_check_mark:
Wildlife page 88
Screenshot of resultResult
:white_check_mark:
Street page 88
Screenshot of resultResult
:white_check_mark:
Macro page 84
Screenshot of resultResult
:white_check_mark:
About Us page 89
Screenshot of resultResult
:white_check_mark:
Contact page 88
Screenshot of resultResult
:white_check_mark:
Login page 88
Screenshot of resultResult
:white_check_mark:
Signup page 88
Screenshot of resultResult
:white_check_mark:

Mobile Accessibility Scores

Tested Result View Result Pass
Homepages 100
Screenshot of resultResult
:white_check_mark:
Blog page 89
Screenshot of resultResult
:white_check_mark:
Landscape page 89
Screenshot of resultResult
:white_check_mark:
Portrait page 89
Screenshot of resultResult
:white_check_mark:
Wildlife page 94
Screenshot of resultResult
:white_check_mark:
Street page 94
Screenshot of resultResult
:white_check_mark:
Macro page 89
Screenshot of resultResult
:white_check_mark:
About Us page 100
Screenshot of resultResult
:white_check_mark:
Contact page 100
Screenshot of resultResult
:white_check_mark:
Login page 100
Screenshot of resultResult
:white_check_mark:
Signup page 100
Screenshot of resultResult
:white_check_mark:

Key Accessibility Highlights

Areas for Improvement

While the overall accessibility scores are high, there are a few areas where improvements could be made:

Technologies Used

Language Used:

Frameworks - Libraries - Programs Used:

  1. Django Purpose: A high-level Python web framework that encourages rapid development and clean, pragmatic design. Use Case: Used for building the backend, managing databases, handling user authentication, and rendering templates.

  2. Bootstrap Purpose: A popular front-end framework for developing responsive, mobile-first websites. Use Case: Used for styling the website, creating responsive layouts, and ensuring a consistent design across devices.

  3. Cloudinary API Purpose: A cloud-based image and video management service. Use Case: Used for handling image uploads, storage, and optimization, ensuring fast and reliable content delivery.

  4. Pillow Purpose: A Python Imaging Library that adds image processing capabilities to your Python interpreter. Use Case: Used to manage and process image uploads, including resizing and format conversions.

  5. JavaScript Purpose: A programming language that enables dynamic content on web pages. Use Case: Used for front-end interactions such as the search bar functionality, dropdowns, and form validations.

  6. GitHub Purpose: A platform for version control and collaborative development. Use Case: Used to host the project repository, manage version control with Git, and collaborate through issues and pull requests.

  7. JQuery Purpose: A fast, small, and feature-rich JavaScript library. Use Case: Used to simplify HTML document traversal and manipulation, event handling, and animation.

  8. SQLite Purpose: A lightweight, disk-based database that doesn’t require a separate server process. Use Case: Used as the database for storing all application data during development.

  9. Chrome DevTools Purpose: A set of web developer tools built directly into the Google Chrome browser. Use Case: Used for debugging JavaScript, analyzing runtime performance, and optimizing website responsiveness.

  10. Balsamiq Purpose: A wireframing tool that allows designers to create sketches of their web pages or applications. Use Case: Used for creating wireframes and mockups to plan the layout and design of the website before development.

  11. Responsive Design Mode Purpose: A browser tool that allows developers to view their website on different screen sizes and resolutions. Use Case: Used to test and ensure the website is responsive across a range of devices, including mobile phones and tablets.

  12. Coolors.co Purpose: An online tool for generating color palettes. Use Case: Used to select and create the color scheme for the website, ensuring a visually appealing design.

  13. StartBootstrap.com Purpose: A website offering free and premium Bootstrap themes and templates. Use Case: Used as a resource for finding Bootstrap templates and inspiration for the website’s design.

  14. Heroku Purpose: Used to deploy the Django application. Use Case: Heroku is a cloud platform that lets companies build, deliver, monitor, and scale apps.

Future Plans

  1. Enhanced User Profiles

    • Description: Develop detailed user profiles where photographers can showcase their portfolios and follow others.
    • Objective: To create a more personalized and interactive community experience.
  2. Advanced Search and Filtering

    • Description: Implement advanced search options based on categories and tags to help users find specific content easily.
    • Objective: To improve content discoverability and user experience.
  3. Mobile App Development

    • Description: Create a mobile app for Android and iOS to allow users to access and upload content on the go.
    • Objective: To increase accessibility and engagement with a mobile-friendly solution.
  4. Social Media Integration

    • Description: Add features that allow users to share their photos directly to social media platforms like Instagram and Facebook.
    • Objective: To broaden the reach of shared content and attract more users.
  5. Photography Challenges

    • Description: Organize photography challenges to engage the community and showcase talent.
    • Objective: To increase user participation and foster a vibrant community atmosphere.
  6. FAQ Page

    • Description: Develop a comprehensive FAQ page to address common user queries and provide guidance on using the site.
    • Objective: To enhance user support and reduce the need for direct inquiries by offering readily accessible information.

Bugs

During the development and testing phases of this project, several bugs were identified and subsequently fixed. Below is a summary of the bugs encountered, along with the steps taken to resolve them.

Known Issues

Search Functionality

Bug List and Fixes

  1. Bug: Navigation Menu Not Collapsing on Mobile

    • Description: On mobile devices, the navigation menu was not collapsing correctly after a menu item was selected, leaving the menu open and obstructing content.
    • Cause: The JavaScript responsible for toggling the navigation menu was not correctly targeting the collapse element.
    • Fix: Updated the JavaScript to properly target the collapse element and added an event listener to close the menu after a link is clicked.
    • Status: Fixed
  2. Bug: Image Upload Fails on Certain File Types

    • Description: Users reported that the image upload feature would fail when attempting to upload certain file types, such as .gif and .bmp.
    • Cause: The server-side validation was too restrictive, only allowing .jpg and .png files.
    • Fix: Updated the validation rules to include additional image file types and added appropriate error handling to inform the user if an unsupported file type is uploaded.
    • Status: Fixed
  3. Bug: Form Validation Errors Not Displaying

    • Description: When users submitted forms with invalid data, the form would refresh but not display any validation error messages, leaving users unaware of what needed to be corrected.
    • Cause: The form template was not properly rendering the validation error messages passed from the backend.
    • Fix: Updated the form templates to correctly display validation errors by including error messages next to each form field.
    • Status: Fixed
  4. Bug: 500 Internal Server Error on Photo Detail Page

    • Description: Users occasionally encountered a 500 Internal Server Error when attempting to view the Photo Detail page.
    • Cause: The issue was caused by a null reference in the database when trying to fetch details for a photo that had been deleted or did not exist.
    • Fix: Implemented additional checks to ensure that the photo exists before attempting to load the detail page, and provided a user-friendly error message if the photo is not found.
    • Status: Fixed
  5. Bug: Slow Load Times on Blog Page

    • Description: The Blog page was experiencing slow load times, especially when there were many posts with large images.
    • Cause: Images were not being optimized for web display, leading to unnecessarily large file sizes.
    • Fix: Integrated image compression on upload and added lazy loading for images to improve page load times.
    • Status: Fixed

Heroku Deployment

This project uses Heroku, a platform as a service (PaaS) that enables developers to build, run, and operate applications entirely in the cloud.

Deployment steps are as follows, after account setup:

Heroku needs three additional files in order to deploy properly.

You can install this project's requirements (where applicable) using:

If you have your own packages that have been installed, then the requirements file needs updated using:

The Procfile can be created with the following command:

Local Deployment

This project can be cloned or forked in order to make a local copy on your own system.

For either method, you will need to install any applicable packages found within the requirements.txt file.

The database provided by Django db.sqlite3 is only accessible within the workspace environment. In order for Heroku to be able to access the database, a new database suitable for production needs to be created. I am using a postgreSQL database instance hosted on CI Database as this service is free.

Requirements

The requirements.txt file lists all the dependencies needed to run the project. Below is a brief description of each package included in this file:

Cloudinary

Specifically, when you set DEFAULT_FILE_STORAGE to use Cloudinary, all media files, including static files, might be uploaded to Cloudinary during the collectstatic process. This can cause unexpected behavior, especially if you intended to keep static files locally.

  1. To avoid issues: Temporarily Remove Cloudinary Storage: Before running python3 manage.py collectstatic, temporarily remove or comment out the DEFAULT_FILE_STORAGE setting.

  2. Run Collectstatic: Execute the collectstatic command to gather all static files locally.

  3. Re-enable Cloudinary: After collecting static files, re-enable the DEFAULT_FILE_STORAGE to Cloudinary if needed.

In the current configuration, I've added 'SECURE': True to the CLOUDINARY_STORAGE settings to ensure all media files are loaded over HTTPS, which enhances security.

alt text

Credits

Acknowledgements