Django is the framework for designing the web applications using python.While starting with Django we have to setup/create the virtual environment in our working directory then we can go for building the web application.
πΆ COMMANDS :
- Gives the path where you want to create a project folder: cd /Users/nishant/Desktop (Note : There is space between the cd & /)
- Then create a folder : mkdir my_projects
- Then Create the virtual environment using python : python3 -m venv env (Here env is the name of environment you can give the name as per your choice).
- Then we have to activate the virtual environment using command :source env/bin/activate (env is the name of an environment )
- After that the environment is ready to work with the given directory now we have to install the django only in given environment using command : pip install django
- Then we are creating the project using django : django-admin startproject first_project (Here first_project is the name of the project you can give the name as per your choice).
- Then open the project : cd first_project
- Finally we have to run the server using command : python3 manage.py runserver
- After that in terminal the ip address is created for the launch the project on web : i.e. 127.0.0.1:8000
- Copy the ip address and paste it on chrome.
- Done ππ».
Top comments (0)