GithubHelp home page GithubHelp logo

helloflask's Introduction

Based on the doggie book

Demo

demo

Dependencies

python3

pipenv

flask

flask-bootstrap

... and lots of tool, I'll put there late

Install

Install pipenv at first, create a virtual environment

pipenv install
pipenv shell
flask run

Todo

comments

follower&following lists

all the test case

a better email html page

-----------------All texts below is my nonsense-------

pipenv shell & exit

each time change .env

need to exit virtualenv and reinitiate again

pipenv install python-dotenv


deployed with docker


Create database tables

flask shell
>>>from app.models import db
>>>db.drop_all() 
>>>db.create_all()

drop old tables and create new

Insert Rows

>>>from app import User,Role
>>>admin_role = Role(name='Admin')
>>>user_susan = Role(username='susan',role=user_role or admin_role etc)
>>>db.session.add(admin_role) or add_all([admin_role,user_susan])
>>>db.session.commit()

Modify & delete & query Rows

>>>admin_role.name ='Administrator' & session.add & commit
>>>db.session.delete(rolename) & commit
>>>Role.query.all() || filtry_by(role=).all()

Migrate

sudo pipenv install flask-migrate
flask db init
flask db migrate -m "initial migration"
flask db upgrate

helloflask's People

Contributors

yeecai avatar

helloflask's Issues

Can't import db

Cause some import before db was buggy
So db in .app can't be imported by others

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.