(
    request,
    workspace=None,
    template_name='dash/dashboard_workspaces.html',
    template_name_ajax='dash/dashboard_workspaces_ajax.html'
)
return render(request, template_name, context)
Workspaces list.

    :param django.http.HttpRequest request:
    :param string workspace: Workspace slug.
    :param string template_name:
    :param string template_name_ajax: Template used for AJAX requests.
    :return django.http.HttpResponse:
Workspaces list.
Workspaces list .
def dashboard_workspaces(
    request,
    workspace=None,
    template_name='dash/dashboard_workspaces.html',
    template_name_ajax='dash/dashboard_workspaces_ajax.html'
):
    """Workspaces list.

    :param django.http.HttpRequest request:
    :param string workspace: Workspace slug.
    :param string template_name:
    :param string template_name_ajax: Template used for AJAX requests.
    :return django.http.HttpResponse:
    """
    # Getting dashboard settings for the user. Then get users' layout.
    dashboard_settings = get_or_create_dashboard_settings(request.user)

    context = get_workspaces(
        request.user,
        dashboard_settings.layout_uid,
        workspace,
        different_layouts=dashboard_settings.allow_different_layouts
    )

    if (
        dashboard_settings.allow_different_layouts
        and context['current_workspace']
    ):
        layout_uid = context['current_workspace'].layout_uid
    else:
        layout_uid = dashboard_settings.layout_uid

    layout = get_layout(layout_uid=layout_uid, as_instance=True)

    context.update({
        'layout': layout,
        'dashboard_settings': dashboard_settings,
    })

    if request.is_ajax():
        template_name = template_name_ajax

    return render(request, template_name, context)
def dashboard_workspaces ( request , workspace = None , template_name = 'dash/dashboard_workspaces.html' , template_name_ajax = 'dash/dashboard_workspaces_ajax.html' ) : # Getting dashboard settings for the user. Then get users' layout. dashboard_settings = get_or_create_dashboard_settings ( request . user ) context = get_workspaces ( request . user , dashboard_settings . layout_uid , workspace , different_layouts = dashboard_settings . allow_different_layouts ) if ( dashboard_settings . allow_different_layouts and context [ 'current_workspace' ] ) : layout_uid = context [ 'current_workspace' ] . layout_uid else : layout_uid = dashboard_settings . layout_uid layout = get_layout ( layout_uid = layout_uid , as_instance = True ) context . update ( { 'layout' : layout , 'dashboard_settings' : dashboard_settings , } ) if request . is_ajax ( ) : template_name = template_name_ajax return render ( request , template_name , context )