This is a tutorial on using Flask Backend with MySQL from Scratch.
=====
..* Python ..* pip ..* MySQL
###Setting up the Project Fork the repository and cd into to Project Directory
- pip install flask
- pip install flask_mysqldb
- pip install wtforms
- pip install passlib
- pip install functools
- Set up the Database
cd myflaskapp
python app.py
Point yor browser to [Localhost](https://localhost:5000)
CREATE DATABASE myflaskapp;
CREATE TABLE users (id INT(11) AUTO_INCREMENT PRIMARY KEY NOT NULL, name VARCHAR(30), username VARCHAR(30),email VARCHAR(100), password VARCHAR(100), register_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP)
CREATE TABLE articles (id INT(11) AUTO_INCREMENT PRIMARY KEY, title VARCHAR(255), author VARCHAR(100), body TEXT, create_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP);
Set Up db.py as follows:
def DBconfig():
dbconfig = {
"host": 'localhost',
"user": 'INSERT DB USER NAME',
"password": 'INSERT DB PASSWORD',
"DBName": 'myflaskapp',
"dictDB": 'DictCursor',
}
return dbconfig