On Tue, 2009-04-28 at 12:24 -0400, Cai Yizhi wrote:
> Hello,
> 
> I am a new comer to Django. I want to create hyper link pointing to a
> local text file (say ~/a.txt). I am wondering how to do this in
> Django?
> 
> I have tried: 
> <a href="file:///~/a.txt" target="_blank">Download</a><br/>
> 
> But it doesn't work.

That's because "~" doesn't mean anything to the filesystem. It's a
special character that is interpreted by the shell (well, some shells;
not all) to mean the current user's home directory. You'll need to put
in the full path to the user's home directory. Look at things like the
standard Python module "pwd" if you need assistance doing that.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
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 group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to