Hi, how are you? It’s a real pleasure to be with you again. In this opportunity, we are going to talk about a free and open-source web application framework written in Python. Indeed, I’m talking about Django. A web framework is a set of components that help to develop websites easier and faster. In other words, Django is a web framework designed to make applications of any complexity in a very reasonable time. In addition, its fundamental goal is to facilitate the creation of complex websites. As you can see, it is a framework of undoubted utility. Consequently, let’s see how to install Django on Windows 10.
Django’s installation is managed from PIP. This is a package management system used to install and manage software packages written in Python. Consequently, it is indispensable to have Python installed in Windows 10. To know how to do it, please check here.
Preparing for installation.
In the first place, creates a folder in any location. I recommend the root directory. In this folder, the projects will be saved. Likewise, assign the name you want. In this case, I’ll use django.
Create a virtual environment for the project.
In order to develop the project, it is necessary to create a virtual environment. With this in mind, open a Command Prompt and use the CD command to go to the django folder.
cd.. cd.. cd django
Once inside the folder, proceed to create the environment, typing the following command:
py -m venv osradar
Please remember to replace osradar with the name you want to assign to the virtual environment.
Once the environment is created, all that remains is to activate it. With this in mind, please type the following command:
Downloading at installing Django
As we said at the beginning, in order to install Django, you need to use PIP. So, open a CMD from the project folder previously activated, and enter the following command:
pip install Django==3.0.2
Press enter and wait for the wizard to download and install the framework.
After installing Django, it’s time to verify the installation. To do so, type the following command:
If everything is working correctly, the console should display the version of the installed items.
Create a new project.
Then create your first project in Django. With this in mind, open a Command Prompt from the virtual environment and execute this command:
django-admin startproject Liberator
Please remember to replace the word Liberator with the name of your project.
Running the server
After the project is created, it’s time to run the server. With this in mind, open a CMD from the newly created project folder. Then execute this command:
python manage.py runserver
Press enter, if everything is correct the server will start.
After starting the server, please copy the IP address to your web browser.
We’ve finally seen how to install Django on Windows 10. From now on you can use this powerful framework written in Python. That’s all for now, please share this post on your social networks. See you next time.