Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to map url with usernames prefixed

host = request.host
host = host.split(':', 1)[0] # Strip off optional ':##' port number
username = None
if host.endswith('.yourdomain.com'):
    username = host.split('.', 1)[0]
 
PREVIOUS NEXT
Tagged: #map #url #usernames #prefixed
ADD COMMENT
Topic
Name
4+8 =