how-to-create-project-and-application-in-django

How to create project and application in Django?

Hello World, Welcome to this website. This is the second tutorial of the series “learn Django from scratch with example“. I have divided this tutorial into the following parts.

What is the difference between project and application in Django?

  • A project refers to the entire application with its all parts. An application is a single module of the project.
  • Let’s understand this with example. Suppose we want to create a blogging website with Django. In the blogging website, There are multiple modules like the post, comment, user, etc. Blogging website is our full project.

How to create a project?

  • For creating a project with Django, open command line
  • Enter the following command
  • django-admin startproject blog
  • The above command will create the project folder with the required files.

How to create an application?

  • For creating an application with Django in the project, go to the project folder
  • Run the following command to create application in project
  • py manage.py startapp post
  • The above command will create a post folder with require files in your project folder (blog).
  • Run project in the browser

So far we have learned to create projects and applications with Django. Now we will run our project with the following command.

  • py manage.py runserver
  • The above command will run the server
  • Open the given path in your browser. In my case, it was http://127.0.0.1:8000

Please add your feedback in the comment section. 🙂 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *