./manage.py runserver 0.0.0.0:8000
I am using the line above as part of the code I borrowed from github (https://github.com/ribeiroit/boh-puppet) to run bag of holding installation.
So far so good on http but not https. How do I modify the line above to incorporate https? I have already obtained ssl certificate from Comodo and updated my nginx conf.d file but the website won't display in https. Any ideas please shoot my way.
Thank you
For this purpose I use the the third-party app
django-extensions
, which offers some nice additional functionalities.One of those extras is
RunServerPlus
.You can then start the server like this:
and open
https://localhost:8000
in your browser.While cezar's recommendation of
django-extensions
is valid to run a server with https, neitherrunserver
orrunserver_plus
should ever be used in a production setting.Quoting Django's documentation:
Quoting django-extensions' documentation:
Now yes, this warning from the
django-extensions
documentation is in reference to a single feature, the interactive console, which will theoretically not be exposed ifDEBUG
is set toFalse
. But this is precisely how Patreon got hacked, and probably others as well. Why even risk it?Instead, it would be far better to deploy your application using one of the officially recommended WSGI servers such as gunicorn or uWSGI.