About the Portfolio Project: Django Delights category

Welcome to the subcategory for the Django Delights Project. This portfolio project can be found in the following courses or paths:

Code Review: Why It’s Important

  • Better code quality – improve internal code quality and maintainability (readability, uniformity, understandability)
  • Finding defects – improve quality regarding external aspects, especially correctness, but also find performance problems, security vulnerabilities, injected malware, etc.
  • Learning/Knowledge transfer – help in transferring knowledge about the codebase, solution approaches, expectations regarding quality, etc; both to the reviewers as well as to the author
  • Increase sense of mutual responsibility – increase a sense of collective code ownership and solidarity
  • Finding better solutions – generate ideas for new and better solutions and ideas that transcend the specific code at hand.
  • Complying to QA guidelines – Code reviews are mandatory in some contexts, e.g., air traffic software

For more on why code reviews are important as well as how to give a code review and ask for one, check out this article.

How to Get Feedback on your Project

Congratulations on finishing your portfolio project! Now you’ll want to follow these steps to get feedback on it.

  1. Post a link to your git repository :slight_smile:
  2. Give us a few sentences about your experience. Was this fun? Difficult? How long did it take?
  3. Check back in—if someone has replied to your post, come see what they have to say.

How to Give Feedback on Another Learner’s Project

Reviewing someone else’s code isn’t just a nice thing to do; it’s also a great opportunity to sharpen your skills by viewing a different perspective.

  1. Refer to the article in your Career Path on How to Review Someone Else’s Code
  2. Click through topics in this subcategory to view other submissions of this project.
  3. Reply to a thread with feedback, encouragement, or letting them know if they did something in a way you hadn’t thought of before!

Hi. Just completed the Django Delights portfolio Project. As requested, here’s a GitHub link and some observations:

https://github.com/elMolo/menuTools

After reading the project requirements, I read every card in the Kanban board, then I followed the first instruction and figured out the information architecture. Then I wireframed a mockup. Once I started writing Python files, it began to take shape rapidly.
Some of the requirements, like depleting the ingredients inventory after each purchase took me a long time to work through, and I still don’t think I chose the correct path. It felt like in order to make that feature happen, I had to use some information that I hadn’t learnt in the course. Specifically, how to call a function that depletes the inventory each time a user makes a menu purchase from within the purchase form, perhaps via a hidden field. I feel this requires creating a custom purchase form that can access the database with the menu item ID from the choice selected in the form. Since I only know how to use generic forms and templates, I couldn’t make that work. What I did is, I redirected purchase form page on form submission to a purchase confirmation page to which I passed the menu item ID.That page called a view function that updated the database with the depleted quantity of each ingredient used in the purchased menu item. It does the trick, but it lacks elegance.
There were other snags that I mostly solved reading through Django documentation.
Although the project goals didn’t focus much on presentation, I snagged a CSS file from a Django course lesson for a fast and dirty implementation. It looks better than nothing, but it needs tweaking and it contains a lot of unused declarations. As a relaxing break from Django coding, I intend to tweak the CSS to make the frontend look presentable.

1 Like

Hello there! Just finished the same project as you.

Good job! I like you put some effort in styling, the elephant logo is also cool :slight_smile: Is it from codecademy course? Or you made it yourself?

Even though I am newbie, I have forked your project and found some points to work on. Hope you’ll find them helpful.

  1. Going to ‘purchases’ page raised me an error ‘Page not found’. You should add ‘/’ after the path URL in ‘urlpatterns’ list from ‘urls.py’. Change “path(‘purchases’, views.Purchases.as_view(), name=‘purchases’)” to “path(‘purchases/’, views.Purchases.as_view(), name=‘purchases’)”. The same for other paths.

  2. When adding ‘recipe requirement’ with the same ‘ingredient’ twice (or more times) to the menu item I got duplicates of ingredients. I didn’t solved this issue in my project completely, but I used a dictionary to gather the info about all the ingredients (with theirs amounts) for every menu item.
    Like ‘dictionary_with_ingredients = {
    ingredient.id : { ‘name’: ‘Sugar’, ‘amount_needed’ = 10, … },
    ingredient.id : { ‘name’: ‘Oil’, ‘amount_needed’ = 5, … },

    }.ingredient[‘amount’]’.
    Due to the same ‘ingredient.id’ value, we have only unique ingredients (from the last entries) on the front-end. Though, still have duplicates in database. :slight_smile:

  3. From what I found on youtube, It is recommended to separate the business logic from views.py to something like ‘services.py’. This way we get clean and easy to read ‘views.py’ file. You can ‘move total_purchases_cost’ and ‘total_sales_price’ functions to a separate file, then import them in ‘views.py’.

Thank you for sharing your project! Really appreciate your work!

And here is mine: GitHub - artyks/delights

Hi Artem, thanks so much for looking over myproject submission.

The logo is my own. I am a graphic designer, so it just came out while I was styling.
I can see why it is so useful to peer review the project. None of the errors you flagged came up when I tested. I am grateful for your review. I will look over your notes and your fork ASAP. I am currently in the middle of a CSS class, so I will focus on getting that done, but I am confident than in a few days I can focus on your contribution, and I’ll be sure to reply. I look forward to looking at the way you did it, BTW. Thanks again.

1 Like

Hihoo fellas! I have just finished my first project with Django at Codecademy.

At this project, since the main focus is to build a working inventory system, I am using Django to handle all of the backend and Bootstrap for giving fresh design to the website. I also utilize the class-based generic views in rendering all of the views. For the form, I am using form-crispy to help me in rendering the form to HTML.

One thing that I might have accomplished and feel proud of it is the menu creation form, where I can dynamically add the dropdown list for the new recipe as well as remove them which I think it’s quite cool.

Here’s the link to my GitHub repo : https://github.com/RandyBrilliant/django-delight

Any feedback and suggestion are welcomed. I hope that my project can also help you in gaining new ideas for the project cause sharing is caring :laughing:.