Unable to access Discovery API

After Referring to Failed to execute refresh metadata course in discovery service - #2 by giovannicimolin I am able to refresh metadata of courses in the discovery service.

But now I am getting server error 500 for:

[service_variant=discovery][django.request] ERROR [ip-172-30-0-192 8485] [/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/django/core/handlers/exception.py:135] - Internal Server Error: /api-docs/
Traceback (most recent call last):
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/django/core/handlers/exception.py”, line 41, in inner
response = get_response(request)
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/django/core/handlers/base.py”, line 249, in _legacy_get_response
response = self._get_response(request)
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/django/core/handlers/base.py”, line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/django/core/handlers/base.py”, line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/django/views/decorators/csrf.py”, line 58, in wrapped_view
return view_func(*args, **kwargs)
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/django/views/generic/base.py”, line 68, in view
return self.dispatch(request, *args, **kwargs)
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/rest_framework/views.py”, line 489, in dispatch
response = self.handle_exception(exc)
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/rest_framework/views.py”, line 449, in handle_exception
self.raise_uncaught_exception(exc)
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/rest_framework/views.py”, line 486, in dispatch
response = handler(request, *args, **kwargs)
File “/edx/app/discovery/discovery/course_discovery/apps/api/views.py”, line 28, in get
schema = generator.get_schema(request=request)
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/rest_framework/schemas.py”, line 305, in get_schema
links = self.get_links(None if public else request)
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/rest_framework/schemas.py”, line 342, in get_links
if not self.has_view_permissions(path, method, view):
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/rest_framework/schemas.py”, line 416, in has_view_permissions
view.check_permissions(view.request)
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/rest_framework/views.py”, line 328, in check_permissions
if not permission.has_permission(request, self):
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/rest_framework/permissions.py”, line 129, in has_permission
'Cannot apply DjangoModelPermissions on a view that ’
AssertionError: Cannot apply DjangoModelPermissions on a view that does not set .queryset or have a .get_queryset() method.

  • Error while accessing Discovery API:
    Log:

ERROR [ip-172-30-0-192 8485] [/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/django/core/handlers/exception.py:135] - Internal Server Error: /api/v1/course_runs/
Traceback (most recent call last):
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/django/core/handlers/exception.py”, line 41, in inner
response = get_response(request)
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/django/core/handlers/base.py”, line 249, in _legacy_get_response
response = self._get_response(request)
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/django/core/handlers/base.py”, line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/django/core/handlers/base.py”, line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/django/views/decorators/csrf.py”, line 58, in wrapped_view
return view_func(*args, **kwargs)
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/rest_framework/viewsets.py”, line 86, in view
return self.dispatch(request, *args, **kwargs)
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/rest_framework/views.py”, line 489, in dispatch
response = self.handle_exception(exc)
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/rest_framework/views.py”, line 449, in handle_exception
self.raise_uncaught_exception(exc)
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/rest_framework/views.py”, line 477, in dispatch
self.initial(request, *args, **kwargs)
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/rest_framework/views.py”, line 395, in initial
self.check_permissions(request)
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/rest_framework/views.py”, line 328, in check_permissions
if not permission.has_permission(request, self):
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/rest_framework/permissions.py”, line 124, in has_permission
queryset = view.get_queryset()
File “/edx/app/discovery/discovery/course_discovery/apps/api/v1/views/course_runs.py”, line 45, in get_queryset
partner = self.request.site.partner
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/django/db/models/fields/related_descriptors.py”, line 407, in get
self.related.get_accessor_name()
django.db.models.fields.related_descriptors.RelatedObjectDoesNotExist: Site has no partner.

I have created the partner for the site in discovery but still getting the error: Site has no partner