Labs ICT
โญ Pro Login

Project Structure

Understanding the files Django creates for you.

Understanding manage.py

When you created your project, a file called manage.py appeared at the root. This is your command center. Almost every Django management command runs through this file.


python manage.py runserver
python manage.py makemigrations
python manage.py createsuperuser
    

It's essentially a wrapper around Django's command-line utility. You rarely need to edit this file โ€” just use it as your entry point for everything.

settings.py โ€” The Brain of Your Project

Inside the inner project folder, you'll find settings.py. This file controls everything โ€” database configuration, installed apps, middleware, templates, static files, and security settings.

Don't try to memorize it all. Just know that when something isn't working right, settings.py is probably where the answer lives. The most common things you'll change are INSTALLED_APPS, DATABASES, and ALLOWED_HOSTS.

urls.py โ€” Routing Requests

The urls.py file maps URLs to views. Think of it as a table of contents for your website. When a user hits a URL, Django looks at this file to figure out what code should run.


from django.contrib import admin
from django.urls import path

urlpatterns = [
    path('admin/', admin.site.urls),
    ]
    

Right now it only has the admin route. You'll add your own paths as you build features.

Try it Yourself โ†’

wsgi.py โ€” Going Live

The wsgi.py file is your bridge to production servers. WSGI stands for Web Server Gateway Interface. When you deploy to a real server like Gunicorn or uWSGI, they use this file to communicate with your Django application.

You won't touch this during development, but it's important to understand that it exists for when you're ready to go live.

๐Ÿงช Quick Quiz

What does the manage.py file do?