Django Project Structure: Understanding Project Root and App Folder

🚀 Day 2: Understanding Django Folder Structure Today, I’m diving deep into the skeleton of a Django project. When you first run django-admin startproject, Django creates a specific set of files. Understanding these is the first step to building scalable web apps! 💻✨ 📁 The Project Root The outer folder is your project container. It holds everything: manage.py: Your command-line best friend. Use it to run the server, create apps, and manage migrations. 📁 The Project Inner Folder (Configuration) settings.py: The "brain" of your project. It stores database info, installed apps, and security settings. urls.py: The "routing table." It tells Django which page to show for each web address. wsgi.py / asgi.py: These handle how your web server talks to your Python code. __init__.py: An empty file that tells Python this directory is a package. 📁 The App Folder (Functionality) Inside your project, you create "Apps" for specific features (like blog or users): models.py: Define your database tables here. views.py: Where the logic lives—this handles requests and returns responses. admin.py: Register your models here to see them in the Django Admin panel. migrations/: Keeps track of all your database changes. 💡 Pro Tip: A Project is the entire website, while an App is a single, reusable feature within it. Stay tuned for Day 3! 👨💻🔥 #Django #Python #WebDevelopment #CodingJourney #100DaysOfCode #BackendDevelopment

  • No alternative text description for this image

To view or add a comment, sign in

Explore content categories