pycharm-flask project build environment and initialize migration model mapping into the database

Since today was still very early, but not much to learn true morning, find a problem now.

Today, talk about how to build initialize migration environment.

1. Open a command window cmd

2. Go to the flask-env virtual environment

First explain a private copy of a virtual environment Python interpreter, you can install proprietary package in this environment, mysql is used to carry out some operations server,

It is for this busy for so long in vain

3 .. where the path enters the manage.py

4. Type pip list to see what the virtual environment of the plug-in installed

5. Type python manage.py db init

6. Back pycharm software migrations occur folder is created successfully

7. Type After completing the above python manage.py db migrate those generated migration file

8. Next we will type python manage.py db upgrade model mapping into the database

 9. We entered in the database mysql query about whether the model is mapped into the database, success!

Such a small matter for a long time to find the true depressed for a long time, but having said that the reason for this interest is because they find a problem for a long time, and finally solve the sense of accomplishment it.

Finally, if I wrote the article really help to you, please point a praise, if one wants to learn together the friends I welcome attention

Published 45 original articles · won praise 96 · views 10000 +

Guess you like

Origin blog.csdn.net/qq_40831778/article/details/104260514
Recommended