Code Self Study Forum

How to create a venv for Flask or Django

Here are some quick notes on creating a Python 3 venv for a Flask or Django project:

$ mkdir my_project_name
$ cd my_project_name
$ python3 -m venv venv
$ echo 'venv/' >> .gitignore

Activate the venv every time you work on the project:

$ source venv/bin/activate

Now you can install Flask or Django:

$ pip install flask

or:

$ pip install django
$ pip install psycopg2
$ django-admin startproject my_project_name .

If you have questions, leave a comment below.

Thank you so much.