当我运行'python manage.py runserver_plus --cert / etc / ssl / cert'时,我无法找到我的证书

问题描述 投票:0回答:1

当我试图访问我的ssl证书时,我收到filenotfound错误,因为我希望我的本地主机在https上运行

python manage.py runserver_plus --cert / etc / ssl / cert

回溯(最近一次调用最后一次):文件“manage.py”,第15行,在execute_from_command_line(sys.argv)文件“E:\ final3 \ venv \ lib \ site-packages \ django \ core \ management__init __。py”,line 381,在execute_from_command_line utility.execute()文件“E:\ final3 \ venv \ lib \ site-packages \ django \ core \ management__init __。py”,第375行,执行self.fetch_command(子命令).run_from_argv(self.argv )文件“E:\ final3 \ venv \ lib \ site-packages \ django \ core \ management \ base.py”,第323行,在run_from_argv中自执行(* args,** cmd_options)文件“E:\ final3 \ venv \ lib \ site-packages \ django \ core \ management \ base.py“,第364行,执行输出= self.handle(* args,** options)文件”E:\ final3 \ venv \ lib \ site- packages \ django_extensions \ management \ utils.py“,第59行,在内部ret = func(self,* args,** kwargs)文件”E:\ final3 \ venv \ lib \ site-packages \ django_extensions \ management \ commands \ runserver_plus.py“,第260行,在句柄self.inner_run(options)文件”E:\ final3 \ venv \ lib \ site-packages \ django_extensions \ management \ commands \ runserver_plus.py“,第337行,在inner_run中ssl_context = make_ssl_devcert(os.path.join(dir_path,root),host ='localhost')文件”E:\ final3 \ venv \ lib \ site-packages \ werkzeug \ serving。 py“,第524行,在make_ssl_devcert中,打开(cert_file,”wb“)为f:FileNotFoundError:[Errno 2]没有这样的文件或目录:'/ etc / ssl \ cert。

python django pyopenssl
1个回答
1
投票

python manage.py runserver_plus --cert /etc/ssl/cert

但是之后

FileNotFoundError: [Errno 2] No such file or directory: '/etc/ssl\cert.

我从你的路径上看到你在Windows上。 /etc/是一个* nix / Linux-only目录,因此您不应该尝试将SSL证书放在那里。

python manage.py runserver_plus --cert E:\final3\ssl文件夹中创建ssl目录后尝试final3

最后,为什么您希望SSL证书访问本地计算机?没有人可以访问您网络上的人员。

© www.soinside.com 2019 - 2024. All rights reserved.