1. Install the library required for Python-Django:
pip install django-extensions
pip install django-werkzeug-debugger-runserver
pip install py0penSSL
2, and add the Django project settings.py to add installed_apps
'werkzeug_debugger_runserver',
'django_extensions',
3. Generate key and files
After the steps of
python manage.py runserver_plus --cert-file cert.crt
have been completed, there will be two files: Cert.crt and Cert.key will appear in the Django project.
4, run the Django project in HTTPS mode
python manage.py runserver_plus --cert cert.crt 0.0.0.0:8000
Use local IP to run
python manage.py runserver_plus --cert server.crt 127.0.0.1:8888
python manage.py runserver_plus --cert server.crt 192.168.0.116:8888
(Local IP custom port:8888)