Fix #449: root_path was ending up as None

This commit is contained in:
Andrew Godwin 2016-12-10 11:48:11 -08:00
parent b52e2e06d7
commit 5a38171fc7
2 changed files with 3 additions and 3 deletions

View File

@ -182,8 +182,8 @@ class AsgiHandler(base.BaseHandler):
self.load_middleware()
def __call__(self, message):
# Set script prefix from message root_path
set_script_prefix(message.get('root_path', ''))
# Set script prefix from message root_path, turning None into empty string
set_script_prefix(message.get('root_path', '') or '')
signals.request_started.send(sender=self.__class__, message=message)
# Run request through view system
try:

View File

@ -84,7 +84,7 @@ class Command(RunserverCommand):
action_logger=self.log_action,
http_timeout=self.http_timeout,
ws_protocols=getattr(settings, 'CHANNELS_WS_PROTOCOLS', None),
root_path=getattr(settings, 'FORCE_SCRIPT_NAME', ''),
root_path=getattr(settings, 'FORCE_SCRIPT_NAME', '') or '',
).run()
self.logger.debug("Daphne exited")
except KeyboardInterrupt: