Debian Codegraph @

demo/demoproject/http/views.py

raw
1 from django_downloadview import HTTPDownloadView
2
3
4 class SimpleURLDownloadView(HTTPDownloadView):
5 def get_url(self):
6 """Return URL of hello-world.txt file on GitHub."""
7 return (
8 "https://raw.githubusercontent.com"
9 "/jazzband/django-downloadview"
10 "/b7f660c5e3f37d918b106b02c5af7a887acc0111"
11 "/demo/demoproject/download/fixtures/hello-world.txt"
12 )
13
14
15 class GithubAvatarDownloadView(HTTPDownloadView):
16 def get_url(self):
17 return "https://avatars0.githubusercontent.com/u/235204"
18
19
20 simple_url = SimpleURLDownloadView.as_view()
21 avatar_url = GithubAvatarDownloadView.as_view()