Introduction
Let's get Django installed and create your first project.
Setup
# Create and activate a virtual environment
python3 -m venv django_env
source django_env/bin/activate # Linux/Mac
# django_env\Scripts\activate # Windows
# Install Django
pip install django
# Create a new project
django-admin startproject mysite
cd mysite
# Run the development server
python manage.py runserver
# Visit http://127.0.0.1:8000/Project structure
mysite/
manage.py # Command-line utility
mysite/
__init__.py
settings.py # Project settings
urls.py # URL configuration
wsgi.py # WSGI entry point
asgi.py # ASGI entry pointAssignment
- Install Django in a virtual environment.
- Create your first Django project and verify the welcome page loads.
- Create your first Django app:
python manage.py startapp pages