【django】激活与启动django- 第一个搭建的博客

博客已搬家至 https://www.v2python.com 。介绍了在 Windows 系统使用 virtualenv 开启虚拟环境的方法,进入虚拟环境目录中的 Scripts 目录操作,进入后可查看 Python 版本和库版本,还提及启动命令 python manage.py runserver。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

博客已经搬家到“捕获完成”:

https://www.v2python.com

 

0.开启虚拟环境

使用 virtualenv

  • 在 Windows 系统上面使用 virtualenv

首先进入到虚拟环境目录中的 Scripts 目录:

C:\Users\Administrator\new_blog_env\v2\cd Scripts

然后输入activate就可以了,会出现如下的结果:

C:\Users\Administrator\new_blog_env\v2\Scripts

在地址的前面出现了一个括号和虚拟环境的名称,这个就表示现在已经在虚拟环境 new_env 中了,之后的所有操作都是在虚拟环境中进行的,直接输入python可以查看当前环境下的 Python 版本,可以得到如下输出:

C:\Users\Administrator\new_blog_env\v2\Scripts>python
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

使用piplist命令可以查看当前环境下的所有包含的库的版本:

C:\Users\Administrator\new_blog_env\v2\Scripts>pip list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.co
nf under the [list] section) to disable this warning.
pip (9.0.1)
setuptools (38.5.2)
wheel (0.30.0)

 

2. 启动

(new_blog_env) C:\Users\Administrator\new_blog_env\v2>python manage.py runserver

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值