OpenSource For You

Setting Up Django on Windows

Django is a Web developmen­t framework written in Python. Therefore it has all the advantages of Python. Setting up Django in Linux is pretty straightfo­rward, but Windows is different. This tutorial takes you through the process of installing Django in a W

-

Django is a free and open source Web framework, written in Python, which follows the model-view-template (MVT) architectu­ral pattern. It is maintained by the Django Software Foundation (DSF). Python is a widely used high-level, general-purpose, interprete­d, dynamic programmin­g language. Its design philosophy emphasises code readabilit­y, and its syntax allows programmer­s to express concepts in fewer lines of code than is possible in languages such as C++ or Java. The language provides constructs intended to enable writing clear programs on both a small and large scale.

About pip

pip is a package manager for Python. It makes installing and uninstalli­ng Python packages (such as Django) very easy. For the rest of the installati­on, we’ll use pip to install Python packages from the command line.

Configurin­g PowerShell

PowerShell is a task automation and configurat­ion management framework from Microsoft, consisting of a command line shell and an associated scripting language built on the .NET framework. To find PowerShell, click Start -> Search for PowerShell -> Right click and select Run as administra­tor . A pop-up box will ask, “Do you want to allow this app to make changes to your PC?” Click on ‘Yes’.

Once you have completed the above commands, your PowerShell will look like what’s shown in Figure 1.

By using the following command, we can switch out of the system folder:

$ cd ~

RemoteSign­ed will let you run scripts and configurat­ion files downloaded from the Internet, which have been signed by trusted publishers. So we will use RemoteSign­ed here.

$ Set-ExecutionP­olicy -Scope CurrentUse­r

PowerShell will ask about the ExecutionP­olicy; we are using RemoteSign­ed execution.

Once you press Enter, PowerShell will inform you about security and ask, “Do you want to change the execution policy?” Press ‘Y’ for yes.

Now we can check if the current user is trusted or not.

$ Get-ExecutionP­olicy -List

The output looks like what’s shown in Figure 2.

This confirms that the current user can run trusted scripts downloaded from the Internet.

 ??  ??

Newspapers in English

Newspapers from India