Discussion on: What are the codes to run in order, for a Django project? I have python3 and pip installed

rehmatworks profile image
Rehmat Alam

You can create the virtual environment before creating your project or after creating the project. To create the project, you use django-admin command and I assume that django-admin command is available globally on your machine. Once the project is created, you should create a virtual environment for it and then you should install all the requirements of the project in that virtual environment (including the main Django package).

So the virtual environment's role here is just to allow you a dedicated place to install your project's requirements. This way, you don't mess your system with the packages required by a certain project.

p.s. if django-admin command is not available globally in your terminal, first create the virtual, activate it, install Django package, and then create your project.