Python django.conf.settings.USE_X_FORWARDED_PORT Examples

The following are 5 code examples for showing how to use django.conf.settings.USE_X_FORWARDED_PORT(). 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.conf.settings , or try the search function .

Example 1
Project: bioforum   Author: reBiocoder   File: request.py    License: MIT License 5 votes vote down vote up
def get_port(self):
        """Return the port number for the request as a string."""
        if settings.USE_X_FORWARDED_PORT and 'HTTP_X_FORWARDED_PORT' in self.META:
            port = self.META['HTTP_X_FORWARDED_PORT']
        else:
            port = self.META['SERVER_PORT']
        return str(port) 
Example 2
Project: Hands-On-Application-Development-with-PyCharm   Author: PacktPublishing   File: request.py    License: MIT License 5 votes vote down vote up
def get_port(self):
        """Return the port number for the request as a string."""
        if settings.USE_X_FORWARDED_PORT and 'HTTP_X_FORWARDED_PORT' in self.META:
            port = self.META['HTTP_X_FORWARDED_PORT']
        else:
            port = self.META['SERVER_PORT']
        return str(port) 
Example 3
Project: python   Author: Yeah-Kun   File: request.py    License: Apache License 2.0 5 votes vote down vote up
def get_port(self):
        """Return the port number for the request as a string."""
        if settings.USE_X_FORWARDED_PORT and 'HTTP_X_FORWARDED_PORT' in self.META:
            port = self.META['HTTP_X_FORWARDED_PORT']
        else:
            port = self.META['SERVER_PORT']
        return str(port) 
Example 4
Project: openhgsenti   Author: drexly   File: request.py    License: Apache License 2.0 5 votes vote down vote up
def get_port(self):
        """Return the port number for the request as a string."""
        if settings.USE_X_FORWARDED_PORT and 'HTTP_X_FORWARDED_PORT' in self.META:
            port = self.META['HTTP_X_FORWARDED_PORT']
        else:
            port = self.META['SERVER_PORT']
        return str(port) 
Example 5
Project: python2017   Author: bpgc-cte   File: request.py    License: MIT License 5 votes vote down vote up
def get_port(self):
        """Return the port number for the request as a string."""
        if settings.USE_X_FORWARDED_PORT and 'HTTP_X_FORWARDED_PORT' in self.META:
            port = self.META['HTTP_X_FORWARDED_PORT']
        else:
            port = self.META['SERVER_PORT']
        return str(port)