django.utils.six.moves.urllib_parse.urlunsplit

Here are the examples of the python api django.utils.six.moves.urllib_parse.urlunsplit taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

Example 1

View license
    def handle(self, **options):
        with transaction.atomic():
            split_url = urlsplit(options['SITE-URL'])
            if (split_url.path not in ('', '/') \
                or split_url.query
                or split_url.fragment):
                raise CommandError('You must only supply the base URL of the site')
            # Then form the base API URL:
            new_url_parts = list(split_url)
            new_url_parts[2] = ''
            self.base_url = urlunsplit(new_url_parts)
            new_url_parts[2] = '/api/v0.9/'
            self.base_api_url = urlunsplit(new_url_parts)
            self.check_database_is_empty()
            self.remove_field_objects()
            self.mirror_from_api()

Example 2

View license
    def handle(self, **options):
        with transaction.atomic():
            split_url = urlsplit(options['SITE-URL'])
            if (split_url.path not in ('', '/') \
                or split_url.query
                or split_url.fragment):
                raise CommandError('You must only supply the base URL of the site')
            # Then form the base API URL:
            new_url_parts = list(split_url)
            new_url_parts[2] = ''
            self.base_url = urlunsplit(new_url_parts)
            new_url_parts[2] = '/api/v0.9/'
            self.base_api_url = urlunsplit(new_url_parts)
            self.check_database_is_empty()
            self.remove_field_objects()
            self.mirror_from_api()