DEV Community

Ranjith srt
Ranjith srt

Posted on

Django

🧠 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/

Enter fullscreen mode Exit fullscreen mode

Top comments (0)