|
1 year ago | |
---|---|---|
instance | 1 year ago | |
printer | 1 year ago | |
tests | 1 year ago | |
app.yaml | 1 year ago | |
readme.md | 1 year ago | |
requiremets.txt | 1 year ago |
readme.md
README.MD
This is the Henderson Design Group end of shift reporter for the warehouse and print room.
Installation Instructions
- Install MariaDB / MySQL on your system
- Create a database and database user for the project
- Create a new
config.py
file. Seeexample_config.py
in the INSTANCE folder. - Create a Python Virtual Envirtonment and install modules
python3 -m venv venv
source activate ven/bin/actiate
pip install -r requirements.txt
- Complete database creation
- Run printer
- Enjoy!
Creating Initial database
Run MariaDB / MySQL
CREATE {database}
USE {database}
CREATE USER '{user}'@'localhost' INDENTIFIED BY '{password}';
GRANT ALL PRIVILEGES ON '{database}'.* TO '{user}'@localhost;
FLUSH PRIVILEGES;
Run Flask Shell
- WINDOWS
set FLASK_APP=printer
set FLASK_ENV=development
flask shell
- Mac / Linux
export FLASK_APP=printer
export FLASK_ENV=development
flask shell
Create tables and initial data:
-
from printer import db
-
from printer.db import *
-
from uuid import uuid4
-
from werkzeug.security import check_password_hash, generate_password_hash
-
db.create_all()
-
brands = ['Lust', 'I Love Wallpaper']
-
groups = ['staff', 'admin']
-
prod_types = ['Sample', 'Print']
-
category = ['Wallpaper', 'XL Mural', 'Mural']
-
for b in brands: db.session.add(Brand(brand_id = str( uuid4() ),brand_name = b))
-
for g in groups: db.session.add(Usergroups(group_id = str( uuid4() ),group_name = g))
-
for p in prod_types: db.session.add(Prodtype(prod_type_id = str( uuid4() ),prod_type_name = p))
-
for c in category: db.session.add(Category(cat_id = str( uuid4() ),cat_name = c))
-
db.session.add( User( user_id = str(uuid4()), user_name = 'admin', user_pass = generate_password_hash('admin'), group_id_fk='{}' ) )
-
db.session.add( User( user_id = str(uuid4()), user_name = 'user', user_pass = generate_password_hash('user'), group_id_fk='{}' ) )
-
db.session.commit()