First try python with flask
- Python language
- Flask framework
- MySQL DB
- install python first
- install pip. pip is package management for python
- editor. in case I used VSCODE
- local server such as: MAMP, XAMPP
- import DB script(down below) to your phpmyadmin
- test run by "python app.py"
-- phpMyAdmin SQL Dump -- version 4.6.5.2 -- https://www.phpmyadmin.net/
-- Host: localhost:3306 -- Generation Time: Feb 15, 2018 at 11:54 AM -- Server version: 5.6.35 -- PHP Version: 7.1.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00";
CREATE TABLE articles
(
id
int(11) NOT NULL,
title
varchar(255) NOT NULL,
author
varchar(100) NOT NULL,
body
text NOT NULL,
create_date
timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE users
(
id
int(11) NOT NULL,
name
varchar(100) NOT NULL,
email
varchar(100) NOT NULL,
username
varchar(30) NOT NULL,
password
varchar(100) NOT NULL,
register_date
timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
ALTER TABLE articles
ADD PRIMARY KEY (id
);
ALTER TABLE users
ADD PRIMARY KEY (id
);
ALTER TABLE users
MODIFY id
int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;