Flask Environment Setup

Dependencies

Before installing flask on the windows system, there is one thing to keep in mind it is essential to an already have python 2.7 version installed at least. However, I would like to suggest python version  3 or the latest one install before going further.

In case if you have not installed python at all on your windows , then don’t worry, just follow the instructions.

Steps to install python on windows

Flask Environment Setup
  • Click on the  Download Python .
  • Once file is  download completely. Then open it by double clicking, and click on yes .
Flask Environment Setup 1
  • After clicking on yes  python installer will  show a window something like this .
Flask Environment Setup 2
  • Click on customize .
Flask Environment Setup 3
  • Now just click on the Next button if you don’t  want to change directory .Then  click on the Install button.
Flask Environment Setup 4
Flask Environment Setup 5
Flask Environment Setup 6
Flask Environment Setup 7

Dependencies

These distributions will be installed automatically during the installation of Flask.

• Werkzeug implements WSGI, the regular Python interface between applications and servers.

• Jinja is a model(or template )language that shows pages serve by your application.

• MarkupSafe comes with Jinja. It escapes the unreliable entry by representing models(templates) to avoid injection attacks.

• ItsDgegerous securely signs the data to ensure its integrity. It is used to protectFlask session cookies.

• Click is a framework for making command line applications. Provide the Flask commands, and also, it allows adding custom management commands.

Optional dependencies

These distributions will not be installed automatically. Flask will detect them and use them if   you install them

• Blinker provides support for signals.

• SimpleJSON is a fast implementation of JSON compatible with Python json

form. It is preferred for JSON operations if installed.

• python-dotenv allows support to load environment variables from .env files

when performing ball commands.

Installation of flask

Once you complete the installation process of python then you can install the flask in a few steps so follows the steps

Create a folder in the documents (or at the desktop)with the name=Flask_app.

Now open cmd and go to that folder, as shown below.

Flask Environment Setup 8

Now open cmd and go to that folder, as shown below.

Now you have to create a virtual environment to keep things simple

Flask Environment Setup 9

So to install a virtual environment, you have to enter the command “py –m  venv env” and hit enter and wait for its installation

Flask Environment Setup 10

After  hitting enter, it will look like as shown below

Flask Environment Setup 11

Now to cross-check the installation process status, you can check it by going to the flask_app folder and look for the new folder named ‘env’ if it was there, then the installation process is successfully completed, as shown below.

So the environment is all set, you just have to activate this virtual environment by using this command “env\scripts\activate” as shown below

Flask Environment Setup 12

After entering the given command and hitting enter, your virtual environment is now activated and able to run your very first app.