![run python flask pycharm community run python flask pycharm community](https://res.cloudinary.com/practicaldev/image/fetch/s--jZZ-YmF8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.postimg.cc/DyP0mCg7/screenshot-from-2019-12-08-16-00-21-1.png)
RUN PYTHON FLASK PYCHARM COMMUNITY MAC
“people.db” is your SQLite database.ĭouble-tap Ctrl on Windows or Cmd on Mac to show the tool windows, then open the Database tools on the top right. Once you re-run your app, nothing will happen if you try to launch, but you should notice that your app creates a file called “people.db” in your project directory. Id = db.Column(db.Integer, primary_key=True)
RUN PYTHON FLASK PYCHARM COMMUNITY CODE
Replace the previous route code with a few lines of configuration for your database code to make your Python script look like this:įrom import SQLAlchemyĪpp.config = 'sqlite:///people.db' We’ll use SQLAlchemy to create and connect to our SQLite database. Then open and you should see “Hello world” printed in your browser. Running Flask’s “Hello World”Ĭreate a new Python file called “app.py” and copy/paste the “Hello world” code from Flask’s homepage: īecause we already have Flask installed as a package in our virtualenv, we can simply right-click on the file and select “Run ‘app'” or “Debug ‘app'”. Simply search and click “Install Package” for each of those three packages. Flask-SQLAlchemy (for connecting to our database).Flask-Restless (for building the RESTful API).We’ll be installing three packages for our project: Once your virtualenv is ready, click the “Install” button to begin installing packages. For example, if my project name is “my_project”, I would have a folder named “venv” inside of “my_project”. You can create the virtualenv anywhere, but I personally prefer to create it in a directory inside of my project.
![run python flask pycharm community run python flask pycharm community](https://blog.kakaocdn.net/dn/KtqR4/btqL8VL1Od4/dd08Njns2B4vaK6sUDngj0/img.png)