Edx-organizations

I’m using edx-organizations from https://github.com/appsembler/edx-organizations in order to make sure only users belonging the site can login in openedx microsites. I’m having the following errors. How can i fix it. First error is from running make test cmd & second one is from make quality cmd.

First Error

Traceback (most recent call last):
  File "/root/edx-organizations/.tox/py27-django18/bin/django-admin.py", line 5, in <module>
    management.execute_from_command_line()
  File "/root/edx-organizations/.tox/py27-django18/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
    utility.execute()
  File "/root/edx-organizations/.tox/py27-django18/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 328, in execute
    django.setup()
  File "/root/edx-organizations/.tox/py27-django18/local/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/root/edx-organizations/.tox/py27-django18/local/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate
    app_config.import_models(all_models)
  File "/root/edx-organizations/.tox/py27-django18/local/lib/python2.7/site-packages/django/apps/config.py", line 198, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/root/edx-organizations/organizations/models.py", line 13, in <module>
    from model_utils.models import TimeStampedModel
  File "/root/edx-organizations/.tox/py27-django18/local/lib/python2.7/site-packages/model_utils/models.py", line 13, in <module>
    from model_utils.managers import (
  File "/root/edx-organizations/.tox/py27-django18/local/lib/python2.7/site-packages/model_utils/managers.py", line 39
    yield from iter
             ^
SyntaxError: invalid syntax
ERROR: InvocationError: '/root/edx-organizations/.tox/py27-django18/bin/django-admin.py test organizations --with-coverage --cover-package=organizations'

Traceback (most recent call last):
  File "/root/edx-organizations/.tox/py27-django111/bin/django-admin.py", line 5, in <module>
    management.execute_from_command_line()
  File "/root/edx-organizations/.tox/py27-django111/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/root/edx-organizations/.tox/py27-django111/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute
    django.setup()
  File "/root/edx-organizations/.tox/py27-django111/local/lib/python2.7/site-packages/django/__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/root/edx-organizations/.tox/py27-django111/local/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate
    app_config.import_models()
  File "/root/edx-organizations/.tox/py27-django111/local/lib/python2.7/site-packages/django/apps/config.py", line 202, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/root/edx-organizations/organizations/models.py", line 13, in <module>
    from model_utils.models import TimeStampedModel
  File "/root/edx-organizations/.tox/py27-django111/local/lib/python2.7/site-packages/model_utils/models.py", line 13, in <module>
    from model_utils.managers import (
  File "/root/edx-organizations/.tox/py27-django111/local/lib/python2.7/site-packages/model_utils/managers.py", line 39
    yield from iter
             ^
SyntaxError: invalid syntax
ERROR: InvocationError: '/root/edx-organizations/.tox/py27-django111/bin/django-admin.py test organizations --with-coverage --cover-package=organizations'
_______________________________________________________________________________ summary ________________________________________________________________________________
ERROR:   py27-django18: commands failed
ERROR:   py27-django111: commands failed
Makefile:15: recipe for target 'test' failed
make: *** [test] Error 1

Second Error

/root/edx-organizations/.tox/quality/local/lib/python2.7/site-packages/pep8.py:2124: UserWarning:

pep8 has been renamed to pycodestyle (GitHub issue #466)
Use of the pep8 tool will be removed in a future release.
Please install and use `pycodestyle` instead.

$ pip install pycodestyle
$ pycodestyle ...

  '\n\n'
organizations/admin.py:11:1: E302 expected 2 blank lines, found 1
organizations/backends.py:56:97: E231 missing whitespace after ','
organizations/middleware.py:13:1: W391 blank line at end of file
organizations/models.py:53:17: E128 continuation line under-indented for visual indent
organizations/models.py:54:17: E128 continuation line under-indented for visual indent
organizations/models.py:55:17: E128 continuation line under-indented for visual indent
organizations/models.py:56:17: E128 continuation line under-indented for visual indent
ERROR: InvocationError: '/root/edx-organizations/.tox/quality/bin/pep8 --config=.pep8 organizations'
_______________________________________________________________________________ summary ________________________________________________________________________________
ERROR:   quality: commands failed
Makefile:8: recipe for target 'quality' failed
make: *** [quality] Error 1

yield from is Python 3 syntax. You are running with Python 2. I don’t know how you installed everything, so I’m not sure where it went wrong. Are you sure you want to be using the appsembler fork of edx-organizations?

Hi ned, yes, i’m using python 2.7 which is suitable for openedx. I installed edx-organizations as the instructions from https://github.com/appsembler/edx-organizations .
And the only way i can separate learners preventing from logging in the website of known address but not registered in openedx microsites is the appsembler fork of edx-organizations, i think. Feel free to guide me if i’m wrong.
What i’m facing in my microsites is; i have two sites: mysite.com, sub.mysite.com and if learner register for sub.mysite.com, he/she can also login to mysite.com with that registered account. I want to prevent it. I’m using openedx native installation and hawthorn release.