myFlaskApp
First try python with flask
Project
- Python language
- Flask framework
- MySQL DB
Usage
- 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"
MySQL script
https://www.phpmyadmin.net/
-- phpMyAdmin SQL Dump -- version 4.6.5.2 ---- 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";
myflaskapp
--
-- Database: articles
--
-- Table structure for table 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;
users
--
-- Table structure for table 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;
-- -- Indexes for dumped tables
articles
--
-- Indexes for table ALTER TABLE articles
ADD PRIMARY KEY (id
);
users
--
-- Indexes for table ALTER TABLE users
ADD PRIMARY KEY (id
);
-- -- AUTO_INCREMENT for dumped tables
articles
--
-- AUTO_INCREMENT for table articles
MODIFY id
int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
ALTER TABLE users
-- AUTO_INCREMENT for table ALTER TABLE users
MODIFY id
int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;