Re: How to I create download link of some file using django

2020-01-23 Thread Kasper Laudrup
Hi Aditya, On 23/01/2020 12.46, aditya surana wrote: What if i don't want to add this additional feature?. Then don't? Kind regards, Kasper Laudrup -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop re

Re: How to I create download link of some file using django

2020-01-23 Thread aditya surana
What if i don't want to add this additional feature?. On Monday, June 24, 2019 at 6:44:22 PM UTC+5:30, Nishant Boro wrote: > > You can use this simple module: > > https://github.com/nishant-boro/django-rest-framework-download-expert > > This module provides a simple way to serve files for download

Re: How to I create download link of some file using django

2019-06-24 Thread Nishant Boro
You can use this simple module: https://github.com/nishant-boro/django-rest-framework-download-expert This module provides a simple way to serve files for download in django rest framework using Apache module Xsendfile. It also has an additional feature of serving downloads only to users belo

Re: How to I create download link of some file using django

2011-05-31 Thread Ivo Brodien
you are welcome! > I have another question here. It seems that django.contrib.staticfiles > can be used to handle some static files during the 'debug' mode while > using the embedded 'runserver' from django. However, would it be > possible if I just develop my website using the system's Apache and

Re: How to I create download link of some file using django

2011-05-31 Thread Kann
Thanks for your help Ivo, I have another question here. It seems that django.contrib.staticfiles can be used to handle some static files during the 'debug' mode while using the embedded 'runserver' from django. However, would it be possible if I just develop my website using the system's Apache an

Re: How to I create download link of some file using django

2011-05-31 Thread Ivo Brodien
> I am a bit confused about how to set the MEDIA_URL variable here. > Currently, I am testing the web using Django embedded webserver and > doesn't have a proper url yet. Should my MEDIA_URL be something > like... http://my_machine_name:8000/media/ yes, but so in your template you do: > ### in

Re: How to I create download link of some file using django

2011-05-31 Thread Ivo Brodien
Hi did you read this documentation about serving static files? In generally you don’t want serve files through django, but through your actual webserver (e.g. Apache, nginx, lighttpd...). However during development you can make django serve them. See: Serving static files in development https:

Re: How to I create download link of some file using django

2011-05-31 Thread Kann
Dear all, I am a bit confused about how to set the MEDIA_URL variable here. Currently, I am testing the web using Django embedded webserver and doesn't have a proper url yet. Should my MEDIA_URL be something like... http://my_machine_name:8000/media/ Kann On May 26, 12:42 pm, Boštjan Mejak wrot

Re: How to I create download link of some file using django

2011-05-26 Thread Boštjan Mejak
Fix some_file = open('bla/bla/bla/', "rw")tosome_file = open('bla/bla/bla/', "r") Fix that "rw" to just "r". You just want the user to read (a.k.a. get) the file, not have write access to it. -- You received this message because you are subscribed to the Google Groups "Django users"

Re: How to I create download link of some file using django

2011-05-26 Thread Kann
Thanks Florian, but I am still confused about what's happening. Below is the concept of my codes and perhaps you can help: from django.core.files import File some_file = open('bla/bla/bla/', "rw") django_file = File(some_file) t = loader.get_gemplate('somewhere/temp.html') c = Context({'file':d

Re: How to I create download link of some file using django

2011-05-26 Thread Florian Apolloner
Hi, file.url is what you are looking for (assuming MEDIA_URL is configured correctly) Cheers, Florian -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this