paint-brush
How to create a new project in Djangoby@DjangoTimes
1,446 reads
1,446 reads

How to create a new project in Django

by GilbishAugust 18th, 2019
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Django is a web framework for perfectionists with deadlines. It was designed to make common web development tasks fast and easy. In this article we gonna learn how to create a project in Django. We must have Django installed in our system to create the project. The Project is the name of project we created,you can use any other name as you like. The Django folder directory structure will look something like this: "Django folder" The server is currently running at localhost:8000/ in the browser, here you will see an animation of rocket flying.

Company Mentioned

Mention Thumbnail
featured image - How to create a new project in Django
Gilbish HackerNoon profile picture

Django is a web framework for perfectionists with deadlines.Using it you can create many cool projects. It was designed to make common web development tasks fast and easy.

In this article we gonna learn how to create a project in Django.It's so easy like a piece of cake to create a project in Django.

We must have Django installed in our system.Use below commands to install it:

pip install django

In order to see the version of Django type Python from your shell.Then at the python prompt ,try to import Django like this:

>> import django
>> print(django.get_version())
2.2

Django is installed,now Finally we can create the project. Create a new directory in which we will place our Django project.

mkdir DjangoFolder
cd DjangoFolder

mkdir will create a new directory by name DjangoFolder and cd is used to move inside that folder using shell.

Now in shell type the following magical words:

django-admin startproject Project

and BOOM, it will create a Django project by name Project inside the DjangoFolder directory. The Project is the name of project we created,you can use any other name as you like.

The DjangoFolder directory structure will look something like this:

I told you, it's just a piece of cake to create project in Django,don't be afraid to read official documentations of Django. More informations are available in the docs.

Use cd command to move inside the Project directory,remember you are currently in DjangoFolder, we have to move inside Project directory to run the server.

cd Project

Now use the following commands in order to run the server:

python manage.py runserver

Go to localhost:8000/ in the browser,here you will see a cool animation of rocket flying. Something like below picture:

Thanks for your valuable time,i appreciate your effort,keep learning and never stop. Feel free to place your doubts or comments.

ThankYou.