Skip to content

TheBrown/myFlaskApp

Repository files navigation

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

-- 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";

-- -- Database: myflaskapp


-- -- Table structure for table articles

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;


-- -- Table structure for table users

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

-- -- Indexes for table articles

ALTER TABLE articles ADD PRIMARY KEY (id);

-- -- Indexes for table users

ALTER TABLE users ADD PRIMARY KEY (id);

-- -- AUTO_INCREMENT for dumped tables

-- -- AUTO_INCREMENT for table articles

ALTER TABLE articles MODIFY id int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

-- AUTO_INCREMENT for table users

ALTER TABLE users MODIFY id int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

About

First try python with flask and MySQL DB

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published