comparison downloads/management/commands/dlwgetcat.py @ 1039:bd59a599b9a3

Update dlwgetcat to use site scheme.
author Brian Neal <bgneal@gmail.com>
date Thu, 31 Dec 2015 12:35:31 -0600
parents b59c154d0163
children
comparison
equal deleted inserted replaced
1038:950dbf75634c 1039:bd59a599b9a3
40 40
41 for dl in downloads: 41 for dl in downloads:
42 ext = os.path.splitext(dl.file.name)[1] 42 ext = os.path.splitext(dl.file.name)[1]
43 dl.dest_filename = slugify(dl.title) + ext 43 dl.dest_filename = slugify(dl.title) + ext
44 44
45 base_url = "{}://{}{}".format(settings.SITE_SCHEME,
46 Site.objects.get_current().domain,
47 settings.MEDIA_URL)
48
45 output = render_to_string('downloads/commands/wget_cat.html', { 49 output = render_to_string('downloads/commands/wget_cat.html', {
46 'downloads': downloads, 50 'downloads': downloads,
47 'domain': Site.objects.get_current().domain, 51 'base_url': base_url,
48 'MEDIA_URL': settings.MEDIA_URL,
49 }) 52 })
50 53
51 self.stdout.write(output) 54 self.stdout.write(output)