Contains the currently-in-development project by HarvardX to bring the annotation tool currently living in the edX platform to a more accessible LTI implementation.
13
stars
7
forks
source link
Daphne + SSL + WhiteNoise for local development #134
This PR adds support for running an SSL development server using Daphne + WhiteNoise.
Changes:
Removes django-sslserver.
Adds WhiteNoise to MIDDLEWARE in order to serve staticfiles.
Updates wsUrl config value in text and image hxighlighter templates so that the port number is included in the websocket URL.
Updates README with details on running Daphne with SSL.
Additional Notes:
The problem this PR is solving is that django-sslserver does not support ASGI/Daphne, and while the default runserver command does support ASGI/Daphne, it does not support SSL (or at least it does not provide a way to configure daphne -- which would obviate the need for this PR).
One way to handle this is to run 2 processes: daphne to handle websocket requests, and django-sslserver to handle everything else, including static files. For example:
But when we do this, we also have to configure the wsUrl in the hxighlighter templates to point to a different port than the main application. It would be simpler if we could have daphne handle everything, including staticfiles:
This PR adds support for running an SSL development server using Daphne + WhiteNoise.
Changes:
django-sslserver
.MIDDLEWARE
in order to serve staticfiles.wsUrl
config value in text and image hxighlighter templates so that the port number is included in the websocket URL.Additional Notes:
The problem this PR is solving is that
django-sslserver
does not support ASGI/Daphne, and while the defaultrunserver
command does support ASGI/Daphne, it does not support SSL (or at least it does not provide a way to configure daphne -- which would obviate the need for this PR).One way to handle this is to run 2 processes: daphne to handle websocket requests, and
django-sslserver
to handle everything else, including static files. For example:But when we do this, we also have to configure the
wsUrl
in the hxighlighter templates to point to a different port than the main application. It would be simpler if we could have daphne handle everything, including staticfiles:This is the approach taken by the PR. If there's a better way, definitely open to it!
@nmaekawa Thoughts?