Join us

Stuck while installing Django? Here’s some steps for you to follow

0_8sYJGv4MChDKt5Ty.jpeg

Hello, long time no see. I am back with another article for you guys. Here’s some steps that will guide you through a smooth installation of the Python web framework: Django.

Let’s start with the basics. Go to https://www.python.org/ and click on the downloads section. You’ll find the latest version of Python there. Click on download and wait for it to get downloaded.

After you have downloaded it, open the application. You will find something like this. The versions may vary as I took this picture from the internet.

Remember to check the box stating “Add Python 3.5 to PATH”. The 3.5 might be different for you depending on the version you have downloaded.

These checkboxes will be checked my default but if it is not then do check the ‘pip’ checkbox as it will help you to download and install other python packages.

After the setup is successful, go to the Command Prompt and type “python”.

These checkboxes will be checked my default but if it is not then do check the ‘pip’ checkbox as it will help you to download and install other python packages.

After the setup is successful, go to the Command Prompt and type “python”.

If your setup is successful, it will provide the version of Python that you are currently using.

Now, the final part which you all have been waiting for: How to install Django.

First, open your Documents folder or any folder that you wanna create your Django project in.

I am assuming you all are comfortable with the command prompt, if you are not the ‘cd’ here stands for change directory. So, I am in my ‘my_django’ folder as you can see from the picture attached below.

After checking this, you can go back to your command prompt and type in this:

This command will activate the virtual environment in Django.

Now, you just need to install Django by typing: “pip install django” for Windows and wait for the installation to be complete.

After the installation is complete, you need to create a new project to start working on what you have planned to do. Now, I have created a new project under folder “my_django” named “my_django_app”. For creating a new project, we use the commands given below:

Now, open your text editor and drop the folder there. For me, it is ‘my_django’. The text editor I am using is Visual Studio Code.

You can see the my_django_app folder that I have created. It has inbuilt files such as asgi.py, wsgi.py etc. I won’t get into details but here’s a short introduction to all these files.

  1. manage.py: To run commands.
  2. __init__.py: Tells python that it contains python code.
  3. wsgi.py and asgi.py: Provide hooks for web servers such as Apache or Nginx.
  4. settings.py: Configures Django.

I won’t get into further details as this article is solely about the installation procedure.

I hope you find this useful, thank you!


Only registered users can post comments. Please, login or signup.

Start blogging about your favorite technologies, reach more readers and earn rewards!

Join other developers and claim your FAUN account now!

Avatar

Prajukta Dey

@prajuktadey
Currently a student at Kalinga Institute of Industrial Technology.
User Popularity
29

Influence

441

Total Hits

1

Posts