This is in development. I try to send url of my file in views.py : 
   
 return render(request, "export.html", {'out': urlOut})

and in my template I have the link : 

Lien du <a href="{{out}}"> fichier </a>

but when I open it I have this link : 

http://127.0.0.1:8000/home/myuser/Data/01/export.txt 

and I want to have this to download the file : 
/home/myuser/Data/01/export.txt 

Have you any ideas? 

(sorry i'm newbie in django ^^)

Le mardi 2 mai 2017 14:04:05 UTC+2, Antonis Christofides a écrit :
>
> Is this in production or development? What is the url that doesn't work? 
> What happens when you try the url?
>
> Regards,
>
> A.
>
> Antonis Christofideshttp://djangodeployment.com
>
> On 2017-05-02 11:28, Sixtine Vernhes wrote:
>
> Hi ! 
>
> I try to create a link on Django who download a static csv file, but I 
> have no idea how to do. 
> In my settings.py :
>
> STATIC_URL = '/static/'
> STATICFILES_DIRS = (
>     os.path.join(BASE_DIR, "static/"),
> )
>
> and my file is in this directory 
>
> Would anyone have an idea ? 
>
>  -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users...@googlegroups.com <javascript:>.
> To post to this group, send email to django...@googlegroups.com 
> <javascript:>.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/c505a804-3cc6-4584-a47a-bffadee6fb5e%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/c505a804-3cc6-4584-a47a-bffadee6fb5e%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e136ff80-bd25-4a06-ae08-9401e28c3c23%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to