How To Create A Django Project

How To Create A Django Project

To create a brand new Django Project you can use the django-admin command followed by the startproject subcommand, followed by the name you would like to assign to the project. If you have multiple Django projects you might want to work on, you can create a directory to hold all of those projects. In our case, we have a djangoprojects directory and all of the development of new Django Projects will happen in there. Let’s navigate to that directory and create a fresh Django Project now.


django-admin startproject myproject

By simply typing django-admin startproject myproject at the terminal, a new Django project will be scaffolded for us. You will not see any feedback right away, but rest assured this command does indeed build a new Django project for you.

django-admin startproject myproject

This creates a new directory named myproject inside of the djangoprojects directory. We can navigate into that directory using cd myproject, and then list the files with the ls command.

newly created django project

Notice that there is a file named manage.py and a directory named myproject.

Inside of this newly created myproject directory are some additional files that Django needs to make your project work. These files are the __init__.py, asgi.py, settings.py, urls.py, and wsgi.py files. We can see them by using cd myproject and then using the ls command once again.

django init asgi settings urls wsgi

How To Create A Django Project Summary

Excellent work! You have created a new Django Project and can begin building out the various components when you are ready to do so. Learn More: