Django Installation Guide

Jul 15, 2024

Django Installation Guide

Prerequisites

  • Python Installation: Ensure Python is installed on your system.
    • Download Python from python.org.
    • Basic assumption is you know how to install Python.

Steps to Install Django

  1. Install Virtual Environment

    • Command: pip install virtualenv
    • Confirms installation: Requirement already satisfied (if already installed).
    • Purpose: Isolate project dependencies.
    • Example tools: Node.js, React (similar to package.json for dependencies).
  2. Create and Activate Virtual Environment

    • Command: virtualenv env_name
    • Example: virtualenv env
    • Navigate to environment: cd env/scripts
    • Activate environment: activate (Windows) or source env/bin/activate (Mac/Linux).
    • Confirmation: Shell prompt changes indicating activation.
  3. Install Django

    • Command: pip install django
    • Verify installation:
      • Open Python shell: python
      • Import Django: import django
      • Check version: django.__version__ (Expected: 4.11 or latest).

Creating Django Project

  1. Start a New Project

    • Command: django-admin startproject project_name
    • Example: django-admin startproject core
    • Check: A folder named core is created with necessary files.
  2. Open Project in Code Editor

    • Navigate to project folder: cd core
    • Open in VS Code: code .
    • Main files inside:
      • manage.py: Bridge to communicate with Django.
      • __init__.py: Marks directory as a Python package.
      • asgi.py: Asynchronous Server Gateway Interface.
      • wsgi.py: Web Server Gateway Interface.
      • settings.py: Contains project settings.
      • urls.py: URL mappings.

Next Steps

  • Create and understand Django applications.
  • Detailed command usage with manage.py in future lessons.

Additional Learning Resources

  • Data Science & Full Stack Development Courses
    • Offered by Newton School.
    • Include top-notch training and placement support.
    • Free Registration: Find links in the video description.
    • Suitable for those wanting to become Data Scientists or Full-Stack Developers.

Summary

  • The video covers installation and setting up Django and creating a basic project structure to get started. Further videos will delve into application creation and more detailed usage.

Call to Action

  • Check out the courses offered at Newton School if you are interested in becoming a Data Scientist or Full Stack Developer.

See you in the next video!