官术网_书友最值得收藏!

Installing Django and Django REST frameworks in an isolated environment

We have created and activated a lightweight virtual environment. It is time to run many commands that will be the same for either Linux, macOS, or Windows.

First, run the following command to install the Django web framework:

pip install django==1.11.5

The last lines of the output will indicate that the django package has been successfully installed. The process will also install the pytz package that provides world time zone definitions. Take into account that you may also see a notice to upgrade pip. The next lines show a sample of the four last lines of the output generated by a successful pip installation:

Collecting django
Collecting pytz (from django)
Installing collected packages: pytz, django
Successfully installed django-1.11.5 pytz-2017.2

Now that we have installed the Django web framework, we can install Django REST framework. Django REST framework works on top of Django and provides us with a powerful and flexible toolkit to build RESTful Web Services. We just need to run the following command to install this package:

pip install djangorestframework==3.6.4

The last lines for the output will indicate that the djangorestframework package has been successfully installed, as shown here:

Collecting djangorestframework
Installing collected packages: djangorestframework
Successfully installed djangorestframework-3.6.4  

After following the previous steps, we will have Django REST framework 3.6.4 and Django 1.11.5 installed in our virtual environment. We will install additional packages as we need them in the forthcoming chapters.

主站蜘蛛池模板: 西青区| 澄城县| 沂源县| 神池县| 建宁县| 务川| 廊坊市| 麻栗坡县| 望谟县| 常宁市| 双辽市| 海伦市| 桂阳县| 巧家县| 新平| 东明县| 惠东县| 靖远县| 舟山市| 富阳市| 宁远县| 襄樊市| 嵊泗县| 新兴县| 周至县| 改则县| 焦作市| 临漳县| 桂林市| 普兰店市| 邢台市| 陆丰市| 高碑店市| 延安市| 汉沽区| 阿巴嘎旗| 商丘市| 盐城市| 宁远县| 盈江县| 囊谦县|