News website using flask and newsapi - Setup Environment : Part 2
Hello guys,
For every project our first step is to setup the environment.
1] Install Python
Obviously we are using flask which is python framework so we need to install python.
How to install python?
If you are a beginner, watch my previous series 21 days python
2]Setting up a virtual Envrionment
We have to create a virtual environment
The
Basically, Virtual is a separate place from you system environment.
Packages in the system will not be included in virtual environment.
For every project our first step is to setup the environment.
1] Install Python
Obviously we are using flask which is python framework so we need to install python.
How to install python?
If you are a beginner, watch my previous series 21 days python
2]Setting up a virtual Envrionment
We have to create a virtual environment
The
venv
the module provides support for creating lightweight “virtual environments” with their own site directories, optionally isolated from system site directories. Each virtual environment has its own Python binary (which matches the version of the binary that was used to create this environment) and can have its own independent set of installed Python packages in its site directories.Basically, Virtual is a separate place from you system environment.
Packages in the system will not be included in virtual environment.
Install flask
pip install virtualenv
Create directory newsapp
mkdir newsapp
Change directory and move on to newsapp
cd newsapp
start virtual environment
virtualenv env
You can change the name of environment replace env with myenv or any other
Now we have to start a virtual environment
\env\Scripts\activate.bat
This will show output like this (env) mean actiavte
(env) E:\flask\newsapp>
3] Setting up Flask
Now install flask
This may take some time
To Check use
flask --version
This will show
Python 3.7.6
Flask 1.1.2
Werkzeug 1.0.1
Next Hello world
❤❤Quarantine python group link ❤❤
8805271377 WhatsApp
Follow here ❤
@mr._mephisto_ Instagram
There will be no restrictions just feel free to learn.
Share and take one more step to share knowledge with others.
Believe in yourself 🤟 you are awesome.
Be safe, Be happy😁
Take care of yourself and your family
Of course, watch movies and series🤟😉
And follow the guidelines of the government
Comments
Post a Comment