diff --git a/readthedocs/core/views.py b/readthedocs/core/views.py index 5f7c5f32dac..63128d22516 100644 --- a/readthedocs/core/views.py +++ b/readthedocs/core/views.py @@ -52,8 +52,10 @@ def random_page(request, project=None): def live_builds(request): builds = Build.objects.filter(state='building')[:5] + WEBSOCKET_HOST = getattr(settings, 'WEBSOCKET_HOST', 'localhost:8088') return render_to_response('all_builds.html', - {'builds': builds}, + {'builds': builds, + 'WEBSOCKET_HOST': WEBSOCKET_HOST}, context_instance=RequestContext(request)) @csrf_view_exempt diff --git a/readthedocs/settings/postgres.py b/readthedocs/settings/postgres.py index e04a0385364..0b952dce7aa 100644 --- a/readthedocs/settings/postgres.py +++ b/readthedocs/settings/postgres.py @@ -26,7 +26,9 @@ 'URL': 'http://odin:8983/solr', } } + SLUMBER_API_HOST = 'http://readthedocs.org' +WEBSOCKET_HOST = 'websocket.readthedocs.org:8088' try: diff --git a/readthedocs/settings/sqlite.py b/readthedocs/settings/sqlite.py index 10b638c03ec..85ea4fe24c2 100644 --- a/readthedocs/settings/sqlite.py +++ b/readthedocs/settings/sqlite.py @@ -29,6 +29,8 @@ SLUMBER_PASSWORD = 'test' SLUMBER_API_HOST = 'http://localhost:8000' +WEBSOCKET_HOST = 'localhost:8088' + HAYSTACK_CONNECTIONS = { 'default': { 'ENGINE': 'haystack.backends.simple_backend.SimpleEngine', diff --git a/readthedocs/templates/all_builds.html b/readthedocs/templates/all_builds.html index ef98f6e13aa..eb706e8e830 100644 --- a/readthedocs/templates/all_builds.html +++ b/readthedocs/templates/all_builds.html @@ -29,7 +29,7 @@

{{ build }}

var $url = $('#url'); var $status = $('#status'); - var ws = new WS('ws://websocket.readthedocs.org:8088/websocket'); + var ws = new WS('ws://{{ WEBSOCKET_HOST }}/websocket'); ws.send_json = function(data) { this.send(JSON.stringify(data)); }