# HG changeset patch # User Brian Neal # Date 1451586931 21600 # Node ID bd59a599b9a3fe32d14961d3e1ce3c1fcb707d6b # Parent 950dbf75634ce1e6777f4d0dfd8430e0f80fc733 Update dlwgetcat to use site scheme. diff -r 950dbf75634c -r bd59a599b9a3 downloads/management/commands/dlwgetcat.py --- a/downloads/management/commands/dlwgetcat.py Thu Dec 31 12:28:30 2015 -0600 +++ b/downloads/management/commands/dlwgetcat.py Thu Dec 31 12:35:31 2015 -0600 @@ -42,10 +42,13 @@ ext = os.path.splitext(dl.file.name)[1] dl.dest_filename = slugify(dl.title) + ext + base_url = "{}://{}{}".format(settings.SITE_SCHEME, + Site.objects.get_current().domain, + settings.MEDIA_URL) + output = render_to_string('downloads/commands/wget_cat.html', { 'downloads': downloads, - 'domain': Site.objects.get_current().domain, - 'MEDIA_URL': settings.MEDIA_URL, + 'base_url': base_url, }) self.stdout.write(output) diff -r 950dbf75634c -r bd59a599b9a3 sg101/templates/downloads/commands/wget_cat.html --- a/sg101/templates/downloads/commands/wget_cat.html Thu Dec 31 12:28:30 2015 -0600 +++ b/sg101/templates/downloads/commands/wget_cat.html Thu Dec 31 12:35:31 2015 -0600 @@ -1,5 +1,5 @@ #!/bin/bash {% for dl in downloads %} -wget -O {{ dl.dest_filename }} http://{{ domain }}{{ MEDIA_URL }}{{ dl.file.name|urlencode }} +wget -O {{ dl.dest_filename }} {{ base_url }}{{ dl.file.name|urlencode }} {% endfor %}