After this small project is a new understanding of the two Web frameworks Django and flask, Django itself has a very complete set of wheels, routines are also fixed, novice in contact with the Django framework, will not be caught in the big hole looking for wheels everywhere;
So in the use of flask this framework will encounter what big pits, first flask is a lightweight web framework, the reason is that it is lightweight because it does not have many wheels, it is not necessary to represent these wheels need our own to build it, that is not necessary, but we need to find these wheels, it is precisely is to exercise your mind, you have to find the wheel before you need to know which wheels, what the role of these wheels, know these, after the next step;
The point is, what does the wheel mean here, and why is it a pit, flask? The documentation and data for this framework are far from as rich and clear as Django, and you may be able to find some information on the web that appears to be what you need, but it is very likely that the modules used, the drivers will have different versions of the pits , from the wheel of patchwork to get together may appear a variety of error, this time you have an error to resolve the error, to check the cause of the error, to check the Patchwork module documentation, there are many versions of the MySQL driver, Pymysql, MYSQLDB, MySQL -connector, Mysql-connector-python, if you choose MySQLdb, then congratulate you this is python2.x version, if you choose Mysql-connector-python, then congratulate you, This only support to python3.4 haha, if the choice of Pymysql, although the program can run, but there will be a variety of warnings such as the long string of red font, looked very annoying, after the actual selection of Mysql-connector will not have any problems;
In addition, there are some use of database additions and deletions to the pit, database statements are not as clean as the Python statement, some statements at the end to add a semicolon, some at the end do not need to add, and sometimes even have the singular and plural object of the difference, a little attention to your statement there is no effect or error.
Finally directly on the source and some notes it ...
Python-web framework-Use SQLAlchemy to create a connection to the database MySQL, in detail with the flask will encounter some big pits!