Django启动失败问题

2021-08-30  本文已影响0人  吕沐枫

Error: [WinError 10013] 以一种访问权限不允许的方式做了一个访问套接字的尝试

  1. 问题描述

    PS D:\web\djangoweb> python .\manage.py runserver
    Performing system checks...
    System check identified no issues (0 silenced).
    Run 'python manage.py migrate' to apply them.
    August 30, 2021 - 11:06:58
    Starting development server at http://127.0.0.1:8000/
    Error: [WinError 10013] 以一种访问权限不允许的方式做了一个访问套接字的尝试。
    PS D:\web\djangoweb>

  2. 造成原因

    一般情况是启动是端口被占用,只要把占用端口的应用程序kill就行

  3. 具体步骤

    • 查看端口占用情况

      cmd> netstat -ano|findstr 8000
      

      PS D:\web\djangoweb> netstat -ano |findstr 8000
      TCP   0.0.0.0:8000  0.0.0.0:0  LISTENING 14140
      UDP   0.0.0.0:8000  *:*           14140
      PS D:\web\djangoweb>

    • 找出对应pid的进程详细信息

      cmd> tasklist |findstr 14140
      

      PS D:\web\djangoweb> tasklist |findstr 14140
      KGService.exe  14140 Consolep     1  21,828 K

    • 杀死对应的进程

      cmd> taskkill /pid 14140 /F
      
上一篇 下一篇

猜你喜欢

热点阅读