What is the file structure of a Django project?

Django is a Python framework for web development. It builds the application structure and integrates various templates, APIApplication Programming Interfaces, database connections, and CRUDCreate Read Update Delete operations. Django not only makes development fast, secure, and scalable but also contributes to open-source development.

Django project

To use Django, we have to install Python in our system. Once we have the Python installed in our system, we must install Django using the PIP—a package manager for Python packages or modules.

Now that we have the Django installed in our system, we can execute the following command to create a Django project.

django-admin startproject educative_site

We can execute the following command to get the file structure of the Django's project we have created recently.

ls -R educative_site/

The details of the created project structure are given below:

educative_site
__init__.py # empty file that tells interpreter that the folder is a package
asgi.py # files that are used by asgi compatible servers to host project after development
settings.py # contains the configuraions about the particular project; Templates,Debug Mode, and Databse declaration
urls.py # contains the url to every endpoint on the project
wsgi.py # files that are used by wsgi compatible servers to host project after development
manage.py # a script with various functions that enables us to effectively interact with our website
File structure of a Django project

Let's look at the following illustration to have a clear understanding of the above-mentioned file structure:

Visual representation of the file structure of a Django project
Visual representation of the file structure of a Django project

The manage.py file

The manage.py file has various functions that enable us to effectively interact with our website. It gives us control as we can specify users, provide credentials, adjust migrations to the database, and, most importantly, run a server on the local host. The server defaults to port 8000.

Typing the following command in the terminal displays all the options related to the manage.py.

python manage.py --help

Some of the options under manage.py are explained below:

  • changepassword: This is used to change a user's password to the admin dashboard (created by Django) of the application.

  • createsuperuser: This adds a new user with their authentication credentials.

  • migrate: This performs changes made to modules to the database schema.

  • check: This identifies any errors on an application.

  • runserver: This hosts the application on a server on the localhost.

Further descriptions of all the commands can be found in the official documentation of Django.

Creating an app with the manage.py script

We can create a Django app using the following command (for further details, visit this Answer on creating an app in Django).

python manage.py startapp educative

Once we have executed the above given command, we'll end up having the following file structure for our project.

Final representation of the file structure of a Django project
Final representation of the file structure of a Django project

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved