Python django.http.HttpResponseGone() Examples

The following are 7 code examples of django.http.HttpResponseGone(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module django.http , or try the search function .
Example #1
Source File: base.py    From GTDWeb with GNU General Public License v2.0 5 votes vote down vote up
def get(self, request, *args, **kwargs):
        url = self.get_redirect_url(*args, **kwargs)
        if url:
            if self.permanent:
                return http.HttpResponsePermanentRedirect(url)
            else:
                return http.HttpResponseRedirect(url)
        else:
            logger.warning('Gone: %s', request.path,
                        extra={
                            'status_code': 410,
                            'request': request
                        })
            return http.HttpResponseGone() 
Example #2
Source File: base.py    From python with Apache License 2.0 5 votes vote down vote up
def get(self, request, *args, **kwargs):
        url = self.get_redirect_url(*args, **kwargs)
        if url:
            if self.permanent:
                return http.HttpResponsePermanentRedirect(url)
            else:
                return http.HttpResponseRedirect(url)
        else:
            logger.warning(
                'Gone: %s', request.path,
                extra={'status_code': 410, 'request': request}
            )
            return http.HttpResponseGone() 
Example #3
Source File: base.py    From luscan-devel with GNU General Public License v2.0 5 votes vote down vote up
def get(self, request, *args, **kwargs):
        url = self.get_redirect_url(**kwargs)
        if url:
            if self.permanent:
                return http.HttpResponsePermanentRedirect(url)
            else:
                return http.HttpResponseRedirect(url)
        else:
            logger.warning('Gone: %s', self.request.path,
                        extra={
                            'status_code': 410,
                            'request': self.request
                        })
            return http.HttpResponseGone() 
Example #4
Source File: base.py    From openhgsenti with Apache License 2.0 5 votes vote down vote up
def get(self, request, *args, **kwargs):
        url = self.get_redirect_url(*args, **kwargs)
        if url:
            if self.permanent:
                return http.HttpResponsePermanentRedirect(url)
            else:
                return http.HttpResponseRedirect(url)
        else:
            logger.warning('Gone: %s', request.path,
                        extra={
                            'status_code': 410,
                            'request': request
                        })
            return http.HttpResponseGone() 
Example #5
Source File: base.py    From python2017 with MIT License 5 votes vote down vote up
def get(self, request, *args, **kwargs):
        url = self.get_redirect_url(*args, **kwargs)
        if url:
            if self.permanent:
                return http.HttpResponsePermanentRedirect(url)
            else:
                return http.HttpResponseRedirect(url)
        else:
            logger.warning(
                'Gone: %s', request.path,
                extra={'status_code': 410, 'request': request}
            )
            return http.HttpResponseGone() 
Example #6
Source File: views.py    From sal with Apache License 2.0 5 votes vote down vote up
def deprecation_view(request):
    return HttpResponseGone(UNICORN, content_type="text/plain") 
Example #7
Source File: apiv1.py    From steemprojects.com with MIT License 5 votes vote down vote up
def apiv1_gone(request):
    return HttpResponseGone(apiv1_gone_msg)