# Python Web Applications: Deploy Your Script as a Flask App
Code snippets supplementing the [Python Web Applications: Deploy Your Script as a Flask App](https://realpython.com/python-web-applications-update/) tutorial.
## Running Locally
Create and activate a Python virtual environment:
```shell
$ python -m venv venv
$ source venv/bin/activate
```
Update `pip` and install the required dependencies:
```shell
(venv)$ pip install-U pip
(venv)$ pip install-r requirements.txt
```
Start the Flask server:
```shell
(venv)$ python main.py
* Serving Flask app "main"(lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: on
* Running on http://127.0.0.1:8080/ (Press CTRL+C to quit)
* Restarting with stat
* Debugger is active!
* Debugger PIN: 339-986-221
```
Navigate your web browser to this address: <http://127.0.0.1:8080/>
A **sample text editor** that shows how to use Qt Designer to create GUI applications.
## How to Run this Application
To run this application, you need to [install `PyQt5`](https://realpython.com/python-pyqt-gui-calculator/#installing-pyqt) on your Python environment. To do that, you can run the following commands in a terminal or command prompt:
```sh
$ python3 -m venv ./venv
$ source venv/bin/activate
(venv)$ pip install PyQt5
```
Once you have [PyQt](https://www.riverbankcomputing.com/static/Docs/PyQt5/) installed, you can run the application by executing the following command:
```sh
(venv)$ cd sample_editor/
(venv)$ python app.py
```
This command will launch the application, so you'll be able to experiment with it.
The set of icons used in this application are part of the [TurkinOS](https://github.com/llamaret/turkinos-icon) icon theme, which is distributed under the [GPL v3.0 license](https://github.com/llamaret/turkinos-icon/blob/master/LICENSE). See `ui/resources/LICENSE` for details.