Inventory Management Sprint 13
Tech Stack
For back-end, we use:
- Django: back-end server
- GCP Compute Engine: where web app hosted
- Email Notification and Food Freshness Detection Python Scripts
For Front-end side:
- Bootstrap: providing style thing
- HTML/CSS
- JavaScript: handle dynamic elements
-
web development
Basically I have three parts: stock management, food freshness and donation. I’ve done with creating a homepage to navigate the three separate apps. For food freshness and and donation, the pages has been created.
Integrate back-end and front-end
Deal with database migrate
error message: Unknown command: “squall”
This is caused by squall
has been deprecated since Django 1.9, currently we use Django 3.0.8. To solve this, do the following commands:
python3 manage.py makemigrations your_app_name
python3 manage.py migrate
python3 manage.py sqlmigrate freshness 0001
How to connect MySQL database through Django Shell
First you’ll need to configure the database’s name, host, password in settings.py
under your apps
Type following command to invoke Django Shell:
Python3 manage.py shell
Then type your command to the shell:
>>> from Django.db import connection
>>> cursor = connection.cursor()
>>> cursor.execute('SELECT item FROM freshness_food ORDER BY item')
>>> print(cursor.fetchall())
above is just an example