- 1.Make a new folder
mkdir myproject
- 2.Go to that folder
cd myproject
- 3.Make a Virtual Environment
python -m venv djangoenv
here djangoenv
is the name of environment.
-
- Activate the environment
In Linux/Unix systemsource djangoenv/bin/activate
- Activate the environment
In Windows using command prompt
djangoenv\Scripts\activate
If using git bash terminal you can execute cd djangoenv
and then . Scripts/activate
if the environment is activated you can see (djangoenv)
in the terminal
Now go to project folder by executing cd ..
only if you are inside environment folder use ls
or pwd
command to check your location
install django
pip install django
django-admin startproject testproject .
Here testproject
is the name of django project and .
tells to create the project in current folder i.e myproject
\
Now you can see files and folder created
testproject
manage.py
You can run the development server using command python manage.py runserver