A Journey Through Project-Based Learning

Greg Park
Strategio
Published in
5 min readAug 12, 2022

Scenario

When I am looking to add a tool or technology to my skillset, the most efficient way is for me to create a small project revolving around the idea. This way I am able to learn how the technology works by applying it firsthand.

For this example, I am going to run through my thought process when first wanting to learn about the Django Python Web framework.

The Goal

My experience at the time revolved solely around Python but I wanted to transition to full stack development. I knew a tiny bit of HTML/CSS but had never put it to use. The main focus of this project was to see the interaction between the backend and the front end and to do that by learning the basics of the Django Web framework.

While going about these small projects, I would not focus on trying to create something fully unique. It is completely okay to attempt an idea that has been done before. It may possibly be more beneficial to do a project which has been widely implemented as there will be a lot of resources that could help you at the points you get stuck on.

Photo Credit: Crowdbotics

The Plan

The first iteration of my project would be to implement a web app where users would paste in a recipe and in return the user would receive a breakdown of the micro and macro nutrients for that recipe. Now having an idea in mind, I could further solidify the tools/technologies I would be using throughout the project.

I knew that for the front-end I did not necessarily care about the depth of implementation past raw function as the goal did not include a high-profile design. This would allow me to stick to basic HTML/CSS and possibly vanilla JavaScript for the front-end.

For the back-end, I knew that this project would be oriented around the Django Web Framework which would cause me to use Python. Since I would need a source for the nutrition data and a place to store it, I would need to implement some sort of database. Luckily, Django does have an internal database system in form of “models” as well as its own management system on its admin site.

I was not planning on initially deploying this project to the public so this was the extent of the initial architecture planning.

Environment Setup

When not knowing about a certain tool/technology you’re attempting to implement into your project, the first place to look should be on the website of that tool/technology. I had no prior experience with Django, but luckily, they have a tutorial right on their site that gives you detailed steps on how to set up your first Django project.

Once I set up my Python Virtual Environment, installed Django, and followed through with the tutorial on setting up my project, the next thing I needed to find was the data I was going to use for the nutrition database.

I was able to find a credible, very in-depth Excel spreadsheet provided by MyFoodData.com which I then converted to a CSV file and wrote a script that inputted the data into my database table.

Photo Credit: Valital Technologies

Beginning Implementation

With Django, you’re able to have your web app loaded on your localhost and consistently updating as you’re implementing new features. Before implementing more of the back-end I needed to create a basic HTML page for my project which I could test inputs with. Once this was done I was able to implement the form in which the user would input their recipe and begin implementing the processing of the inputted data.

This was my biggest challenge yet. I was beginning to have issues parsing the input string because the users would not consistently place certain keywords in the recipe in the same order. Without a way to gain consistent input, I could not figure out a way to extract the specific ingredients and the measurements from the text blob I received.

After much research and a few attempted solutions, I learned that natural language processing is not a light subject to be diving into unless I wanted to make it the new basis of my project. While the problem that occurred was very interesting to me, I wanted to stick to my original focus by slightly alerting the idea and putting the current idea to the side.

A Change of Plans

In order to bypass the huge roadblock I faced, I decided to alter the idea of my project and use an external API to process the user inputs and get the related information I needed. With the same general concept of food being involved, the new idea was for a user to input ingredients they have at home and for the web app to return a list of recipes that contain those ingredients along with the macronutrients and the website which the recipe is from.

While I had no previous experience working with an API, I knew that it would be a great experience and that implementing it into my project would largely help me achieve my intended goal without me having to find and extract a new dataset as I did with the previous idea. I ended up finding the free Edamam Recipe Search API which gave me access to a large database of recipes and nutrition info. After creating an account and reading the documentation, I was able to seamlessly integrate this API, largely simplifying the difficulty of my project and allowing me to conclude the implementation of my project.

Closing

Usually reading documentation is the worst way for me to comprehend the uses of a tool/technology. In a project setting, I am able to see a direct application and implement it myself which will help me better grasp what is being done and why. While there are obstacles that occur throughout the way, changing the plan and requirements is a natural part of the process.

Was this helpful? Confusing? If you have any questions feel free to comment below! Make sure to follow if you’re interested in similar content and want to keep learning alongside me!

--

--