=== day01 django开发===
今日重点: 1.虚拟环境virtualenv 2.创建项目 3.启动项目 4.创建第一个页面
1)virtualenv
①什么是虚拟环境? 自己的理解就是为了解决python版本问题和各种python软件包版本的问题的各种冲突 这么理解虚拟环境重新复制了一份python。 ②需要掌握的用法? 创建 在当前文件夹项目创建虚拟环境env virtualenv env 激活 source env/bin/active 退出 deactive
alex@alex-virtual-machine:~/Desktop$ ls
myproject mysite trydajngo
alex@alex-virtual-machine:~/Desktop$ mkdir dev
alex@alex-virtual-machine:~/Desktop$ cd dev/
alex@alex-virtual-machine:~/Desktop/dev$ virtualenv py3
created virtual environment CPython3.8.10.final.0-64 in 529ms
creator CPython3Posix(dest=/home/alex/Desktop/dev/py3, clear=False, global=False)
seeder FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, pkg_resources=latest, via=copy, app_data_dir=/home/alex/.local/share/virtualenv/seed-app-data/v1.0.1.debian.1)
activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
alex@alex-virtual-machine:~/Desktop/dev$ ls
py3
alex@alex-virtual-machine:~/Desktop/dev$ source py3/bin/activate
(py3) alex@alex-virtual-machine:~/Desktop/dev$
```bash
(py3) alex@alex-virtual-machine:~/Desktop$ ls
dev myproject mysite trydajngo
(py3) alex@alex-virtual-machine:~/Desktop$ django-admin startproject meiduosite
(py3) alex@alex-virtual-machine:~/Desktop$ ls
dev meiduosite myproject mysite trydajngo
查看并且启动项目
![启动项目](https://img-blog.csdnimg.cn/91b656f5e78b4ab08b763d9329e8fe46.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBANExlZQ==,size_20,color_FFFFFF,t_70,g_se,x_16)
![打开浏览器](https://img-blog.csdnimg.cn/56500aaf95874ae6a27912aaa345e8f4.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBANExlZQ==,size_20,color_FFFFFF,t_70,g_se,x_16)
![](https://img-blog.csdnimg.cn/56beceb2a06c432e9bb35b1c83dc5d0d.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBANExlZQ==,size_20,color_FFFFFF,t_70,g_se,x_16)
![为什么不显示
](https://img-blog.csdnimg.cn/b55f25c7d8dc4b52ad46ae62b6c40114.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBANExlZQ==,size_20,color_FFFFFF,t_70,g_se,x_16)
|