In this post, we will discuss about Django project’s basic directory structure.

Here is the directory structure:

  • project-name
    This is the root of our web application.
  • app
    This folder organizes all the components of the application.

    • migrations
      This folder contains our migration data that is used to create tables in database.
    • views
      This folder contains all our view files that contains methods corresponding to URLs. In some other technologies, views are called controllers.
      The files are required to make Python treat the directories as containing packages. Packages are a way of structuring Python’s module namespace by using “dotted module names”
      This file contains all our model classes that represents tables in database.
  • project-name/project-name
    This folder is the Django root of our application.

      This is the core setting file of a Django application.
      This file maps URL patterns to methods in view files.
      Web Service Gateway Interface is the Python way of deploying web applications. This file defines an entry point for WSGI compatible web servers.
  • templates
    This folder contains our template files that are html files mixed with Django code.
    This is a command line utility that let us interact with our project.

Creating your first django project