BSIT2B1-ROY-FINALS
MUST READ BEFORE EXECUTING ANYTHING!!!!! EXPLORE THE POWER OF CLASSIC MODELS CRUD API
Take your programming skills to the next level with our Classic Models CRUD API. This powerful tool allows you to seamlessly interact with the Northwind database using Python. Get ready to unleash your potential and create, read, update, and delete data effortlessly!
Before you embark on this exciting journey, ensure that you have Python installed on your PC. Simply type "python" in your terminal to check. In addition, make sure to have your MySQL Workbench installed and the Northwind database imported. Don't worry, we've got you covered with all the necessary files.
To run the Classic Models CRUD API on your PC, follow these simple steps:
Install Dependencies: Open your command prompt and copy-paste the following commands to install the required dependencies: pip install flask flask-mysqldb This will install Flask and Flask-MySQLdb, the essential modules used by the API script.
Configure Your MySQL Server: After configuring your MySQL Server, open the "api_finals.py" script. Make sure that the database configuration within the script (MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DB) matches your own database setup. This ensures seamless access to interact with the tables.
Run the API Script: Locate the "api.bat" file and run it. This batch file takes care of running the API script for you, eliminating the need to open it separately. In case there are connection issues, you can manually run the "api_finals.py" file.
If you encounter the following error: MySQLdb.IntegrityError: (1364, "Field 'customerNumber' doesn't have a default value"), you can execute the following SQL script to resolve it:
ALTER TABLE payments DROP FOREIGN KEY payments_ibfk_1; ALTER TABLE orders DROP FOREIGN KEY orders_ibfk_1; ALTER TABLE customers MODIFY COLUMN customerNumber INT AUTO_INCREMENT;
This script will drop the foreign key constraints on the payments and orders tables and modify the customerNumber column in the customers table to have an auto-increment value.
Enjoy and Optimize: Start exploring the Classic Models CRUD API and witness the power it brings to your programming endeavors. Once you have finished using the client script, be sure to stop the API script as it may consume some of your computer's memory.
Unleash the potential of Classic Models CRUD API today and experience a new level of efficiency and productivity in your programming workflow. Get ready to create, read, update, and delete data like never before!
| __ | ___ ___ | _ | ___ _ _ _____ | -|| . || | | || . || | || | |||||||| ||||_ ||||||| |__|