Django Framework Setting

by lubmalaindia in Teachers > University+

30 Views, 1 Favorites, 0 Comments

Django Framework Setting

django1.jpg

Learn about Django (the Python Framework) step by step.

Install Python and Pip

t-1.png

First of all, install python and Django. Check your version. It is essential to check the version.

Make sure you have Python installed on your system. You can download and install it from python.org.

pip (Python's package installer) is usually installed automatically with Python. You can check if it's installed by running:

Install Virtualenv

t2.png

Install virtualenv using pip:

Create a Virtual Environment

t3.png

Create a directory for your project and navigate to it:


Create a virtual environment:

This will create a directory named venv inside your project directory.

Activate the Virtual Environment

t5.png

Activate the virtual environment. The command varies depending on your operating system:


After activation, you should see the virtual environment's name in your command prompt.

Install Django

t6.png

With the virtual environment activated, now install Django using pip:

Start a New Django Project

t7.png

Create a new Django project by running:


This will create a new Django project named myproject in the current directory.

Run the Development Server

rundevserver.png

Navigate to the project directory and run the development server to ensure everything is set up correctly:



You should see output indicating that the server is running, and you can visit http://127.0.0.1:8000/ in your web browser to see the default Django welcome page.

Deactivate the Virtual Environment

deact.png

When you're done working, you can deactivate the virtual environment by running: