Python django.http.HttpResponseGone() Examples

The following are 7 code examples for showing how to use django.http.HttpResponseGone(). These examples are extracted from open source projects. 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 check out the related API usage on the sidebar.

You may also want to check out all available functions/classes of the module django.http , or try the search function .

Example 1
Project: GTDWeb   Author: lanbing510   File: base.py    License: 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
Project: python   Author: Yeah-Kun   File: base.py    License: 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
Project: luscan-devel   Author: blackye   File: base.py    License: 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
Project: openhgsenti   Author: drexly   File: base.py    License: 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
Project: python2017   Author: bpgc-cte   File: base.py    License: 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
Project: sal   Author: salopensource   File: views.py    License: Apache License 2.0 5 votes vote down vote up
def deprecation_view(request):
    return HttpResponseGone(UNICORN, content_type="text/plain") 
Example 7
Project: steemprojects.com   Author: wise-team   File: apiv1.py    License: MIT License 5 votes vote down vote up
def apiv1_gone(request):
    return HttpResponseGone(apiv1_gone_msg)