Django
Beginner
1 min read
What Is Django and Why Use It
Example
# Install Django and start a new project
# pip install django
# Create a new Django project
django-admin startproject mysite
# Project structure created:
# mysite/
# manage.py <- CLI utility for the project
# mysite/
# __init__.py
# settings.py <- Project configuration
# urls.py <- Root URL configuration
# asgi.py
# wsgi.py
# Navigate into the project
cd mysite
# Create a new application inside the project
python manage.py startapp blog
# App structure created:
# blog/
# migrations/
# __init__.py
# admin.py <- Register models with admin
# apps.py <- App configuration
# models.py <- Database models
# tests.py
# views.py <- Request handlers
# Run the development server
python manage.py runserver
# Visit http://127.0.0.1:8000/
Related Resources
Django Reference
Complete tag & property list
Django How-To Guides
Step-by-step practical guides
Django Exercises
Practice what you've learned
More in Django