🌟 We are Open Source! Check out our repository on GitHub

Django Project Structure

A scalable and maintainable folder structure for Django applications

File Structure

  • myproject
    • __init__.py
    • settings.py
    • urls.py
    • wsgi.py
    • asgi.py
    • apps
      • __init__.py
      • home
      • about
  • manage.py
  • requirements.txt
  • README.md

Directory Structure Explanation

myproject/

The main project folder containing all Django related files.

myproject/__init__.py

An empty file that tells Python that this directory should be considered a Python package.

myproject/settings.py

Contains settings and configurations for the Django project.

myproject/urls.py

Contains URL declarations for the Django project; a “table of contents” of your Django-powered site.

myproject/wsgi.py

An entry-point for WSGI-compatible web servers to serve your project.

myproject/asgi.py

An entry-point for ASGI-compatible web servers to serve your project.

myproject/apps/

Contains individual apps of the Django project.

myproject/apps/home/

Folder for the home app of the Django project.

myproject/apps/about/

Folder for the about app of the Django project.

manage.py

A command-line utility that lets you interact with this Django project in various ways.

requirements.txt

Lists the Python dependencies required for the Django project.

README.md

Documentation file providing an overview and instructions for the project.