1 week coding challenge from Apicbase, it is my first django app.
Description
Create a small Recipe Manager application in Django (Python) in which you can create ingredients and recipes and that allows the calculation of food cost for the recipes.
Technical Requirements
Ingredients
- An ingredient minimally has a name, an article number and a cost for a certain amount. Example: The ingredient “carrot” has a cost of 1 EURO per 500 grams.
- You need to minimally support the following units: ‘grams’, ‘kilograms’, ‘centiliter’, ‘liter’.
- There should be a page to add a new ingredient
- There should be a page to edit an existing ingredient.
- There should be a page to view all ingredients.
- A user should be able to search his ingredients based on name or article number.
Recipes
- A recipe minimally has a name and a list of ingredients with the amounts needed. Example the Recipe for “Carrot Cake” contains 100 grams of “carrot” and 50 centiliters of “cream”.
- There should be a page to create new recipes.
- There should be a page to edit existing recipes.
- There should be a page to view all recipes.
- There should be a page to see the details of a recipe. This page should show the name but also the cost for each ingredient used in the recipe (example: the 100 grams of “carrot” in the “Carrot Cake” recipe would cost 0.2 EURO) and then the total cost for the recipe.
Doing the extra mile, the application delivers:
- Delete ingredient
- Delete recipe
- Image for ingredients
- Fixture (preload database data from file)
- Total recipe cost just sums up all the ingredients costs without converting between different currencies, user could choose his/her currency on a top navbar and the whole page would automatically convert all prices to the chosen currency
- Create user sign up and login so that recipies can then be tied up to a login
- Create Mysql instance and run 'create database recipe_manager;'
- Set enviroment variables:
- 'DJANGO_RECIPE_MANAGER_SECRET_KEY' - random secret string
- 'MYSQL_USER' - mysql database user
- 'MYSQL_PASS' - mysql database password
- 'MYSQL_HOST' - mysql database url
- Clone repo
- cd into cloned repo folder
- add your server ip to settings.py, for example: ALLOWED_HOSTS = ['44.196.172.48']
- pip install Pillow
- run: python manage.py migrate
- run: python manage.py loaddata initialdb
- run: python manage.py runserver 0.0.0.0:8000