Today I implemented one of the features I wanted for a long time: "You May Also Like" recommendations.
The goal was simple—help users discover more recipes without leaving the recipe page while keeping the implementation clean and maintainable.
🍽️ What I built today
✅ Added a "You May Also Like" section on the recipe detail page.
The feature automatically:
Finds recipes from the same category
Excludes the current recipe
Limits the results to three recommendations
Displays the section only when similar recipes are available
⚙️ Backend Improvements
I updated the recipe_detail view to:
Query recipes by category
Exclude the current recipe
Pass similar_recipes to the template
🏗️ Better Template Architecture
While implementing the feature, I discovered a recursive template include issue.
To solve it, I reorganized the templates:
recipe_detail.html is now responsible only for the recommendation section
recipe_card.html contains only a single reusable recipe card
This makes the project much cleaner, easier to maintain, and more scalable.
🐛 Bug Fix
I also tracked down why recipe cards were being duplicated.
The problem turned out to be an incorrect template structure that caused nested includes.
After refactoring, everything renders correctly.
🎨 UI Improvements
The recommendation cards now match the rest of the website with:
Responsive grid layout
Recipe image
Rating
Hover animations
Consistent design system
💡 One thing I enjoy about Django development is that building a feature often leads to improving the architecture as well. Today's work wasn't just about adding recommendations—it was also about making the codebase cleaner and more reusable.
Every feature is another step toward turning this project into a production-ready application.

Top comments (0)