The Pantry App Notification System (P.A.N.S.) utilizes a Raspberry Pi running a Django webserver, weight sensors, and a barcode scanner to keep track of a user's pantry inventory.
sudo apt install mysql-serversudo update-rc.d mysql defaults
- Copy the server configuration file
my.cnfto/etc/mysql/my.cnf sudo mysqladmin create pans_datasudo mysql -u rootUSE pans_data;CREATE USER 'djangouser'@'%' IDENTIFIED WITH mysql_native_password BY 'password';GRANT ALL ON pans_data.* TO 'djangouser'@'%';FLUSH PRIVILEGES;
sudo apt install python3-dev libmysqlclient-dev default-libmysqlclient-devsudo apt install python3-pippip3 install mysqlclientsudo apt install python3-django- Configure the MySQL database
- Add SECRET_KEY to
webserver/pans/pans/settings.py cd webserver/panspython3 manage.py runserver <IP_Address>:8000- NOTE: The IP address used here must be specified in the ALLOWED_HOSTS section of
webserver/pans/pans/settings.py
- NOTE: The IP address used here must be specified in the ALLOWED_HOSTS section of
- NOTE: You must comment out the database line under
[client]in/etc/mysql/my.cnf mysqldump --no-tablespaces -u djangouser -p pans_data | gzip > pans_data.gz
- Configure the MySQL database
gunzip < ~/pans-code/webserver/pans_data.gz | sudo mysql pans_data
python3 weights_sql.py
python3 barcode.py