Create a New Project in Django

In Django, every web application you make is called a project. The projects consists of different applications. An application is a group of files that works on the MVT structure. 

Let's try to understand this with a real life example: When we create a new website, that website is our project here and the different features like news feed, posts, etc are applications in the project.

Creating a new Project in Django.

To create a new project in django, just open your terminal/CMD and navigate to the folder you want to create the project in.

<!-- To create new project -->
$ django-admin startproject ProjectName

Example:

$ django-admin startproject funda

A new folder with your projectname will be created in that directory as shown in the below example:

-funda
    -__init__.py
    -asgi.py
    -settings.py
    -urls.py
    -wsgi.py
>manage.py

So now you have successfully created your django project. Now type the following command in the terminal to run/execute your project.

$ python manage.py runserver

You will get a response in the terminal as shown below:

$ python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).
January 06, 2021 - 19:18:48
Django version 3.0.7, using settings 'djangoblog.settings'
Starting development server at http://127.0.0.1:8000/     
Quit the server with CTRL-BREAK.
Tags: Funda of web it Django tutorials, Django tutorials, Django tutorials funda, django for beginners, how to start django project, how to create a new django project, new project in django

© Copyright - 2018 - 2021 | All rights reserved at Funda of Web IT