Skip to content

Commit

Permalink
Add settings for websocket host.
Browse files Browse the repository at this point in the history
  • Loading branch information
ericholscher committed Apr 13, 2012
1 parent b30a953 commit 36327ed
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion readthedocs/core/views.py
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions readthedocs/settings/postgres.py
Expand Up @@ -26,7 +26,9 @@
'URL': 'http://odin:8983/solr',
}
}

SLUMBER_API_HOST = 'http://readthedocs.org'
WEBSOCKET_HOST = 'websocket.readthedocs.org:8088'


try:
Expand Down
2 changes: 2 additions & 0 deletions readthedocs/settings/sqlite.py
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/templates/all_builds.html
Expand Up @@ -29,7 +29,7 @@ <h3>{{ build }}</h3>
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));
}
Expand Down

0 comments on commit 36327ed

Please sign in to comment.