def post(self, request, page_pk=None):
        if page_pk is not None:
            try:
                page = request.website.pages.select_related()\
                    .get(pk=page_pk)
                app_page = page.app_page_object
            except Page.DoesNotExist:
                raise ErrorResponse(status.HTTP_400_BAD_REQUEST,
                                    {'msg': MESSAGES.get('default_error', "")})
        else:
            app_page = request.page.app_page_object
            page = request.page

        # Page App Admin Form
        PageAppForm = app_page.get_admin_form()
        form = PageAppForm(request.POST, instance=app_page)
            
        if form.is_valid():
            new_app_page = form.save()
            # If page is the current page,
            # refresh the layout section
            if request.page == page:
                # Get layout slug
                placeholder_slug_items = check_placeholder_html_id(
                    page.placeholder_slug)
                layout_section_slug = placeholder_slug_items[0]
                # Rendering layout section
                rendering_context = RenderingContext(request)
                html_rendering = rendering_context.get_html_layout(
                    layout_section_slug)
                # Send response
                data_context = {'msg': MESSAGES.get('app_edit_success', ""),
                                'html': html_rendering,
                                'layout_section_slug': layout_section_slug}
                # Check if the page manager have to be displayed
                if page_pk:
                    data_context['refresh_pages_list'] = True
                    
                response = Response(status.HTTP_200_OK,
                                    data_context)
            else:
                data_context = {'msg': MESSAGES.get('app_edit_success', "")}
                # Check if the page manager have to be displayed
                if page_pk:
                    data_context['refresh_pages_list'] = True
                response = Response(status.HTTP_200_OK,
                                    data_context)
            return self.render(response)
            # render_page = page.render_page(request)

            # if render_page.status_code == 200:
            #     response = Response(status.HTTP_200_OK,
            #                         {"msg": MESSAGES.get('app_edit_success', ""),
            #                          'html': render_page.content,
            #                          'medias': render_page.medias})
            # elif render_page.status_code in [301, 302]:
            #     response = Response(status.HTTP_202_ACCEPTED,
            #                         {"msg": MESSAGES.get('redirection', ""),
            #                          'location': render_page['location']})

        # If form not valid => reload the edit form with messages
        else:
            data_context = {'form': form,
                            'object': app_page}
            if page_pk:
                data_context['page'] = page

            html = render_to_string('administration/app/app-edit.html',
                                    data_context,
                                    context_instance=RequestContext(request))
            raise ErrorResponse(status.HTTP_400_BAD_REQUEST,
                                {'msg': MESSAGES.get('invalid_data', ""),
                                 'html': html})
Send clear command.
dataset/ETHPy150Open ionyse/ionyweb/ionyweb/administration/views/apps.py/PageAppView.post--crossover with--dataset/ETHPy150Open LabPy/lantz/lantz/drivers/legacy/vxi11.py/Vxi11Driver.clear