You might also want to make the textarea readonly otherwise users will be able 
to modify the text which may not be what you want.

You can also use {% include ... %} to include a static file, I do that for help 
pages.

François


On Dec 7, 2013, at 1:13 PM, Tom Lockhart <tlockhart1...@gmail.com> wrote:

> 
> On 2013-12-07, at 4:16 AM, Fatih Tiryakioglu <fatih...@gmail.com> wrote:
> 
>> Hi all,
>> 
>> I want to render a static .txt file from django template, but I can't load 
>> it. I tried some combinations. Here is some of them:
>> 
>>        <textarea src="shortcut/to/text-file.txt" />
>> 
>>        <textarea src="shortcut/to/text-file.txt"> </textarea>
>> 
>>        <textarea> src="shortcut/to/text-file.txt" </textarea>
>> 
>> How can I load the context of this file?
> 
> Not sure about the textarea markup, but I would think that you would need to 
> load the static tag and do something like
> 
> <textarea src="{% static "shortcut/to/text-file.txt" %}"/>
> 
> Take a look at the html your browser is getting and see if the paths for your 
> text files look similar to the paths already working for images.
> 
> hth
> 
>                   - Tom
> 
> 
>> 
>> Thanks all.
>> 
>> Note: I can render static image files, so it is not a settings problem.
>> 
>> 
>> 
>> -- 
>> 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 http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/b54669cb-6d8e-481a-a4f7-665fd1e0876d%40googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
> 
> Tom Lockhart
> tlockhart1...@gmail.com
> 
> <T_Lockhart_791_email_sig.png>
> 
> 
> -- 
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/FE709582-B7A6-4575-A12A-2CD35A235853%40gmail.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to