Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update django middleware.

  • Loading branch information...
commit 15b2721da69261cdbf41514c6f4b6c45182f65bc 1 parent 4afb3d8
Zach Kelling authored
Showing with 11 additions and 9 deletions.
  1. +8 −6 bebop/management/commands/runbebop.py
  2. +3 −3 bebop/middleware.py
14 bebop/management/commands/runbebop.py
View
@@ -3,7 +3,10 @@
from django.contrib.staticfiles.finders import find
from django.conf import settings
from bebop import autoreload
-from bebop.server import run_eval, run_watcher, run_websocket
+from bebop.server import run_server
+from bebop.websocket import run_websocket
+from bebop.static import run_static
+from bebop.watcher import run_watcher
from twisted.application import internet, service, app
from twisted.web import server, resource, wsgi, static
from twisted.python import threadpool, log
@@ -87,14 +90,13 @@ def handle(self, addrport='', *args, **options):
def _start_bebop(self, use_repl=True):
host = getattr(settings, 'BEBOP_WEBSOCKET_HOST', '127.0.0.1')
- port = getattr(settings, 'BEBOP_WEBSOCKET_PORT', '9000')
+ port = getattr(settings, 'BEBOP_WEBSOCKET_PORT', '1983')
paths = getattr(settings, 'BEBOP_WEBSOCKET_PATHS', settings.TEMPLATE_DIRS + settings.STATICFILES_DIRS)
# start websocket server
factory = run_websocket(host, port)
- if use_repl:
- # start eval tcp client server
- eval_server = run_eval(factory)
- factory.attach_eval(eval_server)
+ # start eval tcp client server
+ server = run_server(factory)
+ factory.attach_server(server)
# start file watcher
reactor.callInThread(run_watcher, factory, paths)
6 bebop/middleware.py
View
@@ -2,12 +2,12 @@
from django.conf import settings
HOST = getattr(settings, 'BEBOP_WEBSOCKET_HOST', '127.0.0.1')
-PORT = getattr(settings, 'BEBOP_WEBSOCKET_PORT', '9000')
-with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'bebop.js')) as f:
+PORT = getattr(settings, 'BEBOP_WEBSOCKET_PORT', '1983')
+with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../lib', 'bebop.js')) as f:
RELOADER_SCRIPT = ''.join(('<script type="text/javascript">', f.read(), '</script>'))
RELOADER_SCRIPT.replace('127.0.0.1', HOST)
-RELOADER_SCRIPT.replace('9000', PORT)
+RELOADER_SCRIPT.replace('1983', PORT)
class ReloaderMiddleware(object):
def process_response(self, request, response):
Please sign in to comment.
Something went wrong with that request. Please try again.