How to create a new Django project?

Published on Aug. 22, 2023, 12:17 p.m.

To create a new Django project, you can use the django-admin command-line utility. Here are the steps you need to follow:

  1. Open a command prompt or terminal window.
  2. Navigate to the directory where you want to create the Django project.
  3. Type the following command to create a new Django project:
django-admin startproject projectname

Replace projectname with the name you want to give to your Django project.
4. Once the command finishes executing, a new directory will be created with the same name as your project containing various files and directories.

That’s it! You have now created a new Django project. To verify that everything is working, you can run the development server using the following command:

python manage.py runserver

Then you can visit http://localhost:8000 in a web browser to see the default “Welcome to Django” page.

Tags: