Django — Project
Create Project
django-admin startproject mysite
Project Files
mysite/
├── manage.py # Command-line utility
└── mysite/
├── __init__.py # Python package
├── settings.py # Configuration
├── urls.py # URL routing
├── asgi.py # ASGI config
└── wsgi.py # WSGI config
manage.py Commands
python manage.py runserver # Start server
python manage.py migrate # Run migrations
python manage.py createsuperuser # Create admin user
python manage.py shell # Interactive shell
python manage.py collectstatic # Collect static files
Settings Overview
# settings.py
INSTALLED_APPS = [...] # Installed applications
MIDDLEWARE = [...] # Request/response middleware
ROOT_URLCONF = 'mysite.urls'
TEMPLATES = [...] # Template configuration
DATABASES = {...} # Database settings
STATIC_URL = '/static/' # Static files URL
Secret Key
# Generate new secret key
from django.core.management.utils import get_random_secret_key
print(get_random_secret_key())
URL Configuration
# mysite/urls.py
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('blog.urls')),
]
Mini Practice
- Create a new project
- Explore the project structure
- Modify settings
- Add URL patterns
Up Next
Continue with Applications — organizing code into apps.
Related Topics
Frequently Asked Questions about Project
What is Project in Django?
Project is a fundamental concept in Django. This lesson explains it step by step with clear examples, making it easy for beginners to understand.
How do I learn Project?
Start by reading the explanation above, then try the code examples. Practice by modifying the examples and experimenting with different values. Hands-on practice is the best way to learn Project.
Why is Project important in Django?
Project is essential for Django development. Understanding this concept will help you write better code and solve real-world problems more effectively.