Installation

18-Jan-2024

Rapidly install Django with our quick guide – your shortcut to seamless web development. Start coding in no time!

Installing Django

Welcome to Django! Follow these steps to quickly set up and install Django on your system.


Step 1 : Prerequisites

Before you begin, ensure you have the following prerequisites installed on your system:

- Python : Django is a Python web framework, so you need to have Python installed. Download and install Python from [ python.org ]



Step 2 : Install virtualenv (if not already installed)

If you don't have virtualenv installed, run the following command to install it :



pip install virtualenv


Step 3 : Create a Virtual Environment

Creating a virtual environment is a good practice to isolate your Django project dependencies. Open your terminal or command prompt and run the following commands :


# Create a virtual environment named "myenv"
python -m venv myenv

# Activate the virtual environment

# (Choose the appropriate command for your operating system)

# Windows :
myenv\Scripts\activate
# MacOs / Linux : source myenv/bin/activate



Step 4 : Install Django

With your virtual environment activated, install Django using the following command :


# Install the Django web framework using pip
pip install django



Step 5 : Verify Installation

To confirm that Django is installed successfully, run the following command :


# Check the installed Django version
django-admin --version


Step 6 : Start a New Project

Now that Django is installed, you can create a new project. Navigate to the directory where you want to create your project and run :


# Create a new Django project named "myproject"
django-admin startproject myproject


Congratulations!
You've successfully installed Django and created your first project. Continue exploring Django by navigating into your project directory and starting the development server :


# Navigate to the "myproject" directory
cd myproject

# Start the Django development server
python manage.py runserver

Visit [ http://127.0.0.1:8000/ ] in your browser, and you should see the Django welcome page.

Now you're ready to dive into Django development!


Comments