Django Tutorial 1 — Project File structure

I am starting a new Course on Django Web Framework. Today we are going to see File structure of Django Project.

Command to create a Django Project

django-admin startproject FirstProject .

in the above command ‘.’ will represent that the FirstProject will be created in same directory.

Following is the File structure of FirstProject

FirstProject

  • settings.py
  • __init__.py
  • urls.py
  • wsgi.py
  • manage.py
  1. settings.py: Here all the applications settings get stored. You can also find the information about middleware used, database connections and path to the main url config.
  2. __init__.py: This is an empty python script which lets python interpreter to treat this directory as python module/package.
  3. urls.py: This file store all url patterns for the web pages of web application. This also stores url-config specific to an application.
  4. wsgi.py: This file acts as a web server gateway interface. It helps in deployment of project in production.
  5. manage.py: This is a command line utility. Helps in creating an application, migrations and so on so forth.

Note: Feel free to comment if you find any mistakes.