subdomains.utils

subdomains.utils.urljoin(domain, path=None, scheme=None)

Joins a domain, path and scheme part together, returning a full URL.

Parameters:
  • domain – the domain, e.g. example.com
  • path – the path part of the URL, e.g. /example/
  • scheme – the scheme part of the URL, e.g. http, defaulting to the value of settings.DEFAULT_URL_SCHEME
Returns:

a full URL

subdomains.utils.reverse(viewname, subdomain=None, scheme=None, args=None, kwargs=None, current_app=None)

Reverses a URL from the given parameters, in a similar fashion to django.core.urlresolvers.reverse().

Parameters:
  • viewname – the name of URL
  • subdomain – the subdomain to use for URL reversing
  • scheme – the scheme to use when generating the full URL
  • args – positional arguments used for URL reversing
  • kwargs – named arguments used for URL reversing
  • current_app – hint for the currently executing application
subdomains.utils.insecure_reverse = <functools.partial object>

reverse() bound to insecure (non-HTTPS) URLs scheme

subdomains.utils.secure_reverse = <functools.partial object>

reverse() bound to secure (HTTPS) URLs scheme

subdomains.utils.relative_reverse = <functools.partial object>

reverse() bound to be relative to the current scheme