When no SELENIUM_DRIVER_ARGUEMNTS are set in settings.py, the error TypeError: 'NoneType' object is not iterable is raised. This should be a simple fix in middleware.py by adding:
if driver_arguments is not None:
for argument in driver_arguments:
driver_options.add_argument(argument)
Instead of iterating directly on driver_arguments.