How to create new project in django

To create a new project in Django, you can follow these steps:

Method 1: Using the Django Command Line Tool

  1. Open a terminal or command prompt.
  2. Install Django using pip: pip install django
  3. Create a new project by running the following command: django-admin startproject projectname (replace projectname with the desired name of your project).
  4. This will create a new directory with the basic structure for a Django project.
  5. Navigate into the project directory: cd projectname
  6. Run python manage.py runserver to start the development server.

Method 2: Using the Django Website

  1. Go to the Django website: www.djangoproject.com
  2. Click on the "Get Started" button.
  3. Follow the instructions to download and install Django.
  4. Once installed, click on the "Create a new project" button.
  5. Fill in the required information, such as project name, author name, and email address.
  6. Click on the "Create project" button.
  7. Django will generate a new project directory with the basic structure.

Basic Project Structure

A Django project typically has the following structure:

Next Steps

Once you have created a new project, you can start building your application by creating new apps, models, views, and templates. Here are some next steps: