info@cubersindia.com | +91-8808682517
How to configure Python Flask in window?

How to configure Python Flask in window?

Flask is the web development light-weighted framework.  In order to do this, it needs to do some configuration to your machine that is I am going to tell you in this post.

First of all, you need to download Python 2.7 from its official website. And install it to your system.

Now you will get the folder named Python 27 in your C drive. Now open it and copy the path and go to your desktop and right-click on My Computer icon and click on properties.

After that, a small window appears and in right bottom, you get a button named Environment Variable, click on it.

Now you will get two boxes of System and User respectively. Under the System, box clicks on path variable and Paste the path that you copied it in beginning.

Now open your CMD and go to your Python 27 and Scripts directly by CMD.

scropts

When you are inside it just type the command: pip install flask

And hit enter, it may take 2 or 3 mins depending upon your INTERNET speed.

Now make your project folder in any directory in your system. In my case let say I have created it in E drive and inside it create another folder named app and again inside it make two folder named templates and static respectively.

Now open any text editor any type then simple hello world! Application code.

flask code

Now open again CMD and run the code like this it in the same directory as I told above

E>: CD flask

E:>flask > CD app

E: flask>app python  __init__.py

Http://127.0.0.1:5000/ is running on…

Something like this will be shown if everything is done file till now. Now open the browser and type the same URL and see the result.

Since Python is case sensitive language so make sure you have typed the same code as above.

If you face any problem regarding configuration or running the code then you can watch this video.

And if still face any problem then you can comment I will definitely reply soon.

🙂 Happy coding !!!!!

Leave a Reply

Close Menu