DEV Community

Nishant Deshmukh
Nishant Deshmukh

Posted on

Django setup for mac

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 :

  1. Gives the path where you want to create a project folder: cd /Users/nishant/Desktop (Note : There is space between the cd & /)
  2. Then create a folder : mkdir my_projects
  3. 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).
  4. Then we have to activate the virtual environment using command :source env/bin/activate (env is the name of an environment )
  5. 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
  6. 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).
  7. Then open the project : cd first_project
  8. Finally we have to run the server using command : python3 manage.py runserver
  9. After that in terminal the ip address is created for the launch the project on web : i.e. 127.0.0.1:8000
  10. Copy the ip address and paste it on chrome.
  11. Done 👍🏻.

🔶 Screenshots :

Image description

Image description

Top comments (0)