如何使用树莓派成功搭建Django开发环境?

2026-05-26 12:530阅读0评论SEO资讯
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计508个文字,预计阅读时间需要3分钟。

如何使用树莓派成功搭建Django开发环境?

Django是Python的强大网络服务器框架。Python有多种框架可供选择。Django在众多框架中脱颖而出,因其高度模块化。许多成功的网站和APP都基于Django开发。安装pip,使用命令:sudo apt-get install python-pip


Django是Python下的一款网络服务器框架。

Python下有许多款不同的框架。

Django是重量级选手中最有代表性的一位。

许多成功的网站和APP都基于Django。

安装pip

sudo apt-get install python-pip python-dev build-essential
sudo pip install --upgrade pip

安装Django

sudo pip install django

安装成功之后我们可以进入python命令行查看django版本:

pi@raspberrypi:~ $ pythonimport django
print(django.VERSION)

安装过程中如果因为下载太慢失败的话,可以更改pip源为国内阿里源,具体内容见我前边写的​​树莓派初始设置​​。

安装过程中遇到报错:

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

因为树莓派默认的python是2.7版本,所以pip默认也是给python2安装的。

阅读全文

本文共计508个文字,预计阅读时间需要3分钟。

如何使用树莓派成功搭建Django开发环境?

Django是Python的强大网络服务器框架。Python有多种框架可供选择。Django在众多框架中脱颖而出,因其高度模块化。许多成功的网站和APP都基于Django开发。安装pip,使用命令:sudo apt-get install python-pip


Django是Python下的一款网络服务器框架。

Python下有许多款不同的框架。

Django是重量级选手中最有代表性的一位。

许多成功的网站和APP都基于Django。

安装pip

sudo apt-get install python-pip python-dev build-essential
sudo pip install --upgrade pip

安装Django

sudo pip install django

安装成功之后我们可以进入python命令行查看django版本:

pi@raspberrypi:~ $ pythonimport django
print(django.VERSION)

安装过程中如果因为下载太慢失败的话,可以更改pip源为国内阿里源,具体内容见我前边写的​​树莓派初始设置​​。

安装过程中遇到报错:

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

因为树莓派默认的python是2.7版本,所以pip默认也是给python2安装的。

阅读全文