Tag

flask installation

Browsing

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 which is 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 the 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 click on path variable and Paste then the path that you copied it in beginning.

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

This image has an empty alt attribute; its file name is how-to-configure-flask-in-python.png

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.

This image has an empty alt attribute; its file name is how-to-configure-flask-in-python-codesnipts.png

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 correct. 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.

Conclusion

I hope you learned explained above, If you have any suggestions, are appreciated. And if you have any errors comment here.

Ok, Thanks for reading this article, see you in the next post.

Happy Coding 🙂

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