简体   繁体   中英

I cant find my certificate when i am running ' python manage.py runserver_plus --cert /etc/ssl/cert '

i am getting filenotfound error when i am trying to access my ssl certificate because i want my local host run on https

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

Traceback (most recent call last):
  File "manage.py", line 15, in <module>
    execute_from_command_line(sys.argv)
  File "E:\final3\venv\lib\site-packages\django\core\management\__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "E:\final3\venv\lib\site-packages\django\core\management\__init__.py", line 375, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "E:\final3\venv\lib\site-packages\django\core\management\base.py", line 323, in run_from_argv
    self.execute(*args, **cmd_options)
  File "E:\final3\venv\lib\site-packages\django\core\management\base.py", line 364, in execute
    output = self.handle(*args, **options)
  File "E:\final3\venv\lib\site-packages\django_extensions\management\utils.py", line 59, in inner
    ret = func(self, *args, **kwargs)
  File "E:\final3\venv\lib\site-packages\django_extensions\management\commands\runserver_plus.py", line 260, in handle
    self.inner_run(options)
  File "E:\final3\venv\lib\site-packages\django_extensions\management\commands\runserver_plus.py", line 337, in inner_run
    ssl_context = make_ssl_devcert(os.path.join(dir_path, root), host='localhost')
  File "E:\final3\venv\lib\site-packages\werkzeug\serving.py", line 524, in make_ssl_devcert
    with open(cert_file, "wb") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/etc/ssl\\cert.

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

but then

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

I see from your paths that you're on Windows. /etc/ is a *nix/Linux-only directory, so you shouldn't be trying to place your SSL certificate there.

Try python manage.py runserver_plus --cert E:\final3\ssl after creating an ssl directory in the final3 folder.

Finally, why on earth do you want an SSL certificate to access your local computer? Nobody can access your information but people on your network.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM