🧠 Django Small Notes (Beginner-Friendly)
✅ What is Django?
Django is a Python web framework.
It helps you build websites and web apps quickly.
It comes with built-in features like user login, admin panel, database management, etc.
🔧 Step-by-Step Setup
1. Check Python
bash
python --version
2. Create Virtual Environment
bash
python -m venv venv
3. Activate the Environment (Windows)
bash
venv\Scripts\activate
4. Install Django
bash
pip install Django
5. Check Django Version
bash
django-admin --version
6. Create Django Project
bash
django-admin startproject myapp
7. Go into the project folder
bash
cd myapp
8. Run the development server
bash
python manage.py runserver
9. Apply Migrations (very important!)
bash
python manage.py migrate
🛠 What These Commands Do:
venv\Scripts\activate → Activates virtual environment
startproject → Creates new Django project
runserver → Starts local web server
migrate → Creates tables in your database
createsuperuser → Creates admin login
🌐 Default Django URL
After running the server, open:
cpp
http://127.0.0.1:8000/