41
loading...
This website collects cookies to deliver better user experience
pip
(python's package manager) but if you missed that, that's fine, you can install the get-pip.py file into your system and run the below code:python get-pip.py
python --version
and pip --version
to check if they return any version number. IF they do, Congratulations !! You installed Python successfully and if not, don't worry there might be some simple issues that can be googled out and resolved easily. virtualenv
that does this thing. It is for installing the Python-related packages into an isolated folder. So, we can install the virtualenv
package in python by following the following steps:pip install virtualenv
pip3
or pip -m
, or however you install normal python modules. This just installs the python virtual environment, we need to create a virtual environment in the current folder.virtualenv venv
venv
can be anything like env
just for your understanding and simplicity it's a standard name kept for the same. After this, you will see a folder of the same name i.e. venv
or any other name you have used. This is the folder where python will keep every installation private to the local folder itself. source venv/bin/activate
venv\Scripts\activate
(venv)
attached in the beginning. This indicates you are in a virtual environment, things you do here, may it be module installation or any configuration related to python will stay in the local folder itself.pip
. pip install django
startproject
this is one of the management commands in Django. The django-admin is a command-line utility for doing the administrative tasks related to Django.django-admin startproject myproject
myproject
can be your project name. After this, you will see one new folder and one file pop up.<project-name>
folder and manage.py
file. We don't have to touch the manage.py
file but we use it in most of the commands to use the Django functionalities, it is quite similar to the django-admin
command. python manage.py runserver
djagno-admin
command, but you need to set certain environment variables and modify the settings.py file as per the project-name. You can use the django-admin
as the steps given in the Django documentation.python manage.py runserver
should be visible in the browser at https://127.0.0.1:8000
as below :Ctrl+C
. #!/usr/bin/env bash
mkdir $1
cd $1
pip install virtualenv
virtualenv venv
source venv/bin/activate
pip install django
django-admin startproject $1 .
clear
mkdir %1
cd %1
pip install virtualenv
virtualenv env
call env\Scripts\activate
pip install django
django-admin startproject %1 .
cls
folder structure
of the Django project. We won't directly go into the code part because that is very easy once you understand the flow of the framework and its internal work. So, thanks for reading and Happy Coding :)