GiHub repository (public): https://github.com/elizabethdaly/deploytoPA
-
server: application.py
-
web page: shopper5.html
-
DAO: zfood.py
-
DB config to edit on PA: dbconfigtemplate.py
-
Virtual environment requirements: requirements.txt
-
Very basic index: index.html
-
All old files in \oldservers
-
Link to app on pythonanywhere: http://elizabethdaly.eu.pythonanywhere.com/shopper5.html
It even looks ok on my phone.
This project is hosted on GitHub at https://github.com/elizabethdaly/data-rep-project
-
server: server_proj2.py
-
web page: shopper5.html
-
DAO: zfood.py
-
DB congig: dbconfig.py
-
DB config to edit on PA: dbconfigtemplate.py
-
Virtual environment requirements: requirements.txt
-
Initial plan: ProposedInterface1.docx
-
Images in \images
-
All early versions in \testing
A repository on GitHub exists as a remote repository. You can clone this repository to create a local copy on your computer by following these instructions:
- On GitHub, navigate to the main page of the repository https://github.com/elizabethdaly/data-rep-project
- Under the repository name, click Clone or download.
- Choose "Clone with HTTPS".
- Open a terminal on your machine. Change the current working directory to the location where you want the cloned directory to be made.
- Type git clone, and then paste the URL you copied in 2 above.
git clone https://github.com/elizabethdaly/data-rep-project
- Press enter to clone the repository to your machine.
Database = datarepresentation
Table = food
MySQL command to create food table:
create table food (
id int NOT NULL auto_increment,
category ENUM('dairy', 'vegetable', 'meat', 'canned'),
name varchar(250),
price DECIMAL(6,2) NOT NULL,
PRIMARY KEY(id)
);
desc food;
Field | Type | Null | Key | Default | Extra |
---|---|---|---|---|---|
id | int(11) | NO | PRI | NULL | auto_increment |
category | enum('dairy','vegetable','meat','canned') | YES | NULL | ||
name | varchar(250) | YES | NULL | ||
price | decimal(6,2) | NO | NULL |
MySQL commands to add some records to food table:
insert into food (category, name, price) values ("meat", "pork", 4.50);
insert into food (category, name, price) values ("dairy", "milk", 2.99);
insert into food (category, name, price) values ("canned", "beans", 0.99);
Started off with basic one provided and gradually added extra:
- Price displayed as two decimal places on initial read from DB and after create & update.
parseFloat(food.Price).toFixed(2)
- CSS Bootstrap: buttons, form
- Added host code to ajax calls
- Link on page to application on pythonanywhere.
Started with basic one provided and added a little to it:
- Allow for decimal type in DB
from decimal import Decimal
- zfoodDAO.py contains foodDAO class
- shopper5.html
- server_proj2.py
- zfoodDAO.py
- Formatting numbers to 2 decimal places in json (Accessed 6 Dec 2019)
- Serialize a decimal object in json (Accessed 4 Dec 2019)
- Bootstrap (last accessed 15 Dec 2019)
- W3schools columns (last accessed 15 Dec 2019) for example.