在Windows上运行Django的'WinError 10013' [英] 'WinError 10013' running Django on Windows

查看:78
本文介绍了在Windows上运行Django的'WinError 10013'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

距离我遇到此问题已经快一个月了,非常感谢您的帮助.尝试登录Django Web应用程序时,我在/accounts/login/遇到OSError.我能够以127.0.0.1:8000/admin登录,但无法在/accounts/login登录,从而产生错误代码:/accounts/login/中的

It has been almost a month since I got this problem, and I really appreciate your help. While trying to login in my Django Web App, i encounter OSError at /accounts/login/.I am able to login in 127.0.0.1:8000/admin, but not in the /accounts/login which produces the Error Code:

OSError at /accounts/login/
[WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions

Request Method: POST
Request URL:    http://127.0.0.1:8000/accounts/login/
Django Version: 1.11.1
Exception Type: OSError
Exception Value:    
[WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions
Exception Location: C:\Python35-32\lib\socket.py in create_connection, line 702
Python Executable:  C:\Python35-32\myvenv_python3\Scripts\python.exe
Python Version: 3.5.2
Python Path:    
['C:\\Users\\Kaleab\\Desktop\\ecomstore',
 'C:\\Python35-32\\lib\\site-packages\\sqlalchemy-1.1.7-py3.5-win32.egg',
 'C:\\Python27',
 'C:\\Python35-32\\myvenv_python3\\Lib\\site-packages',
 'C:\\Python35-32',
 'C:\\Users\\Kaleab\\Desktop\\ecomstore',
 'C:\\Python35-32\\myvenv_python3\\Scripts\\python35.zip',
 'C:\\Python35-32\\DLLs',
 'C:\\Python35-32\\lib',
 'C:\\Python35-32\\myvenv_python3\\Scripts',
 'C:\\Python35-32\\lib\\site-packages',
 'C:\\Python35-32\\lib\\site-packages\\win32',
 'C:\\Python35-32\\lib\\site-packages\\win32\\lib',
 'C:\\Python35-32\\lib\\site-packages\\Pythonwin']
 

可能的原因和解决方法

  1. 原因:套接字访问需要管理特权.尝试的解决方案:•通过导航到虚拟环境,授予管理员对python.exe的访问权限.•导航到CMD.exe,右键单击属性",授予管理员权限.

  1. Cause: Socket access needs administrative privilege. Attempted Solution: • Granted Administrator access to python.exe by navigating to the virtual environment. • Navigate to CMD.exe , right click , properties, grant administrator privilege.

原因:该端口可能已被另一个程序使用.尝试的解决方案:使用TCPView Windows程序检查了端口,并发现端口8000没有被其他程序使用.

Cause: Port can be already used by another program. Attempted Solution: Checked the ports using TCPView windows program and see that the port 8000 is not used by another program.

原因:防火墙和防病毒功能阻止了套接字访问.尝试的解决方案:尝试禁用防火墙和防病毒时,我在帐户/登录/[WinError 10061]时收到另一个错误ConnectionRefusedError,因为目标计算机主动拒绝了它,所以无法建立连接.

Cause: Socket access blocked by Firewall and Antivirus. Attempted Solution: When I tried disabling Firewall and Antivirus, I get another error ConnectionRefusedError at accounts/login/ [WinError 10061] No connection could be made because the target machine actively refused it.

原因:Winsock出现故障.尝试的解决方案:尝试并成功重置了winsock,但这也没有解决.

Cause: Winsock has malfunctioned. Attempted Solution: Tried and successfully reset winsock, but this did not solve it either.

推荐答案

尽管我无法看到在建议的stackoverflow命令中使用了端口8000,但我将以不同的端口运行服务器.使用:python manage.py runserver 8080.

I will take running the server with different port as the answer, although I am not able to see port 8000 is used in stackoverflow suggested commands. Use: python manage.py runserver 8080.

这篇关于在Windows上运行Django的'WinError 10013'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆