Django tutorial : how to create django first project

Oct. 19, 2023 by shrikant patel Posted in programming Category 0 Comments 168 Views

Django tutorial : how to create django first project

Django is an excellent and famous Python framework for creating websites. If you also want to create your first project with the help of Django, then we will give you all the information step by step. With the help of this information, you can create your first website.

Before creating a website or webpage with the help of Django, some important things should already be present in your computer system.

prerequisite to create django website :

  1. python: Python should be already installed on your computer because Django is a framework of Python. You can download Python from its office website.
  2. pip: python is the manager to manage the package of pip, which is installed along with Python. But still, make sure that pip is installed on your computer or not.
  3. Code editor: Code editor is an application with the help of which you write and read your code. you can download any code editor as per your choice. some code editors are VS code, PycharmSublime text, and many more.
  4. Basic understanding of Python: Before starting a Django website project, you must know Python's basic elements and functions.

 

after having all the necessary information and things needed on your computer, you can start the Django project. Which step-by-step are

  • Step 1 - Install Django: First of all you have to install Django on your computer with the help of pip, for that you have to first type pip install django in the code editor's terminal or command prompt.

 

pip install django

 

After typing this and pressing enter button,django downloading will start.

  • Step 2- create django project: After installing django, you will use a command of django to create the project in the terminal of your code editor, which is django-admin startproject myproject. In the place of myproject, you will also write the name of your project.

 

django-admin startproject myproject

 

  • Step 3 - Navigate to your project directory: Now you have to go inside your project, after which you can create an app or web application of yofor project. To go inside the project you have to use cd myproject command.

 

cd myproject

 

  • Step 4 - Create django app:  Now to create django app or web application, we will use another command of django which is python manage.py startapp myapp .  In the place of myapp, you can put your website name also.

 

python manage.py startapp myapp

 

  • Step 5 - Open project folder: Now you can open your project folder in the code editor and check it.  For that, first of all, you have to open your project folder in code editor and then run python manage.py runserver command, as a result of which you will see that you will be able to view your website page on the browser.

 

python manage.py runserver

 

In this way you can start creating your django project. this is just a beginning, after this you can create many features and templates. 

Do you dream of turning your thoughts and words into income ? join us now and become blogger now.
PUBLICBLOGS.IN


programming website
If you went to earn online by just sharing your thoughts then join us now with Google and become blogger now.
PUBLICBLOGS.IN
Related Story
0 Comments

Leave a Comment