Debian Codegraph @

PKG-INFO

raw
1 Metadata-Version: 2.1
2 Name: django-downloadview
3 Version: 2.4.0
4 Summary: Serve files with Django and reverse-proxies.
5 Home-page: https://django-downloadview.readthedocs.io/
6 Author: Benoît Bryon
7 Author-email: [email protected]
8 License: BSD
9 Keywords: file stream download FileField ImageField x-accel x-accel-redirect x-sendfile sendfile mod_xsendfile offload
10 Classifier: Development Status :: 5 - Production/Stable
11 Classifier: License :: OSI Approved :: BSD License
12 Classifier: Programming Language :: Python :: 3 :: Only
13 Classifier: Programming Language :: Python :: 3.8
14 Classifier: Programming Language :: Python :: 3.9
15 Classifier: Programming Language :: Python :: 3.10
16 Classifier: Programming Language :: Python :: 3.11
17 Classifier: Programming Language :: Python :: 3.12
18 Classifier: Framework :: Django
19 Classifier: Framework :: Django :: 4.2
20 Classifier: Framework :: Django :: 5.0
21 Requires-Python: >=3.8
22 Description-Content-Type: text/x-rst
23 License-File: LICENSE
24 License-File: AUTHORS
25 Requires-Dist: Django>=4.2
26 Requires-Dist: requests
27 Provides-Extra: test
28 Requires-Dist: tox; extra == "test"
29
30 ###################
31 django-downloadview
32 ###################
33
34 .. image:: https://jazzband.co/static/img/badge.svg
35 :target: https://jazzband.co/
36 :alt: Jazzband
37
38 .. image:: https://img.shields.io/pypi/v/django-downloadview.svg
39 :target: https://pypi.python.org/pypi/django-downloadview
40
41 .. image:: https://img.shields.io/pypi/pyversions/django-downloadview.svg
42 :target: https://pypi.python.org/pypi/django-downloadview
43
44 .. image:: https://img.shields.io/pypi/djversions/django-downloadview.svg
45 :target: https://pypi.python.org/pypi/django-downloadview
46
47 .. image:: https://img.shields.io/pypi/dm/django-downloadview.svg
48 :target: https://pypi.python.org/pypi/django-downloadview
49
50 .. image:: https://github.com/jazzband/django-downloadview/workflows/Test/badge.svg
51 :target: https://github.com/jazzband/django-downloadview/actions
52 :alt: GitHub Actions
53
54 .. image:: https://codecov.io/gh/jazzband/django-downloadview/branch/master/graph/badge.svg
55 :target: https://codecov.io/gh/jazzband/django-downloadview
56 :alt: Coverage
57
58 ``django-downloadview`` makes it easy to serve files with `Django`_:
59
60 * you manage files with Django (permissions, filters, generation, ...);
61
62 * files are stored somewhere or generated somehow (local filesystem, remote
63 storage, memory...);
64
65 * ``django-downloadview`` helps you stream the files with very little code;
66
67 * ``django-downloadview`` helps you improve performances with reverse proxies,
68 via mechanisms such as Nginx's X-Accel or Apache's X-Sendfile.
69
70
71 *******
72 Example
73 *******
74
75 Let's serve a file stored in a file field of some model:
76
77 .. code:: python
78
79 from django.conf.urls import url, url_patterns
80 from django_downloadview import ObjectDownloadView
81 from demoproject.download.models import Document # A model with a FileField
82
83 # ObjectDownloadView inherits from django.views.generic.BaseDetailView.
84 download = ObjectDownloadView.as_view(model=Document, file_field='file')
85
86 url_patterns = ('',
87 url('^download/(?P<slug>[A-Za-z0-9_-]+)/$', download, name='download'),
88 )
89
90
91 *********
92 Resources
93 *********
94
95 * Documentation: https://django-downloadview.readthedocs.io
96 * PyPI page: http://pypi.python.org/pypi/django-downloadview
97 * Code repository: https://github.com/jazzband/django-downloadview
98 * Bugtracker: https://github.com/jazzband/django-downloadview/issues
99 * Continuous integration: https://github.com/jazzband/django-downloadview/actions
100 * Roadmap: https://github.com/jazzband/django-downloadview/milestones
101
102 .. _`Django`: https://djangoproject.com