Sitemap
Press enter or click to view image in full size

Django Polls Simplified — Installing Django

3 min readDec 19, 2024

--

This is a continuation of the previous article on environment setup:

Prerequisites

  • Python v3.10+
  • Virtual Environment

NOTE:
I will use Conda to manage my virtual environment for this demo. There’s no big difference when using virtualenv or pipenv.

Installation

Creating a Virtual Environment

Using conda, I will create a virtual environment for this. Run the command on your terminal:

conda create --name django-polls python=3.12

The command conda create --name django-polls python=3.12 creates a new isolated Conda environment named django-polls with Python version 3.12 installed. This ensures an independent environment for your Django project, preventing conflicts with other projects or system-level Python installations. The environment allows you to manage dependencies and maintain compatibility with Python 3.12. Once created, you can activate it using conda activate django-polls and install additional packages like Django specific to this environment, ensuring a clean and organized workflow.

Press enter or click to view image in full size

To activate the environment, you run:

conda activate django-polls

To deactivate:

conda deactivate

Working Directory

A working directory is the current folder where your program or command operates, serving as the default location for reading, writing, or executing files.

For an organized working project, create a directory and django-polls, and continue development from there.

Press enter or click to view image in full size

You can open the directory on Visual Studio code:

code .
Press enter or click to view image in full size

Setting Up A Database

Django will use SQLite by default, so you don’t need to set it up.

In the later articles, we will integrate using Postgres.

Installing Django

On your activated environment, install Django:

pip install Django

You can test your installation by running the django-admin command:

django-admin
Press enter or click to view image in full size

(Take a minute to breathe 🧘‍♀️ 🧘‍♂️ , then move on to the next step)

--

--

Chris Achinga
Chris Achinga

Written by Chris Achinga

Software Engineer (Python & Javascript)

Responses (2)