Django安装和卸载

安装与验证

  • 安装

    pip源:
        https://pypi.douban.com/simple/  豆瓣源
        https://pypi.tuna.tsinghua.edu.cn/simple   清华源
    格式:
        pip install django -i https://pypi.douban.com/simple/
    
     pip3 install Django==3.2 # 指定版本
    
  • 验证是否安装成功

    ➜  my_zdh_platform git:(main) ✗ django-admin
    
    Type 'django-admin help <subcommand>' for help on a specific subcommand.
    
    Available subcommands:
    
    [django]
        check
        compilemessages
        createcachetable
        .......
    
    
  • 创建项目

    django-admin startproject 项目名称
    
  • 启动项目

    python3 manage.py runserve # 后面可以指定ip和端口 默认本机 8000端口
    
  • 浏览器访问 http://127.0.0.1:8000/

可以访问说明没有问题,安装成功

卸载

pip3 uninstall Django
posted @ 2022-11-24 09:30  zhq9  阅读(47)  评论(0编辑  收藏  举报