Skip to content

Instantly share code, notes, and snippets.

@mhipo1364
Created October 27, 2015 09:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mhipo1364/4b798654cce0675d8179 to your computer and use it in GitHub Desktop.
Save mhipo1364/4b798654cce0675d8179 to your computer and use it in GitHub Desktop.
This static method generate proper url via given parameters
@staticmethod
def _generate_url(**kwrgs):
"""
This static method generate proper url via given parameters
:param kwrgs:
:return: string
"""
url = settings['CUSTOM_BASE_URL'] + '/{}?'.format(kwrgs.pop('uri'))
for idx, (key, value) in enumerate(kwrgs.items()):
if idx:
url += '&'
url += '{}={}'.format(key, value)
return url
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment