Thursday, January 30, 2014

Re: render .txt file in django template

The template engine doesn't have direct access to the filesystem. You will have to pass the file contents from your view to the template:

1.Load the file in your view
2. Read it into a context variable.
3. Render the context variable in your template

On Thursday, January 30, 2014 3:29:29 PM UTC-6, Fatih Tiryakioglu wrote:
Hi all,

Could you please show me how can I render .txt static files (they are user comments) in django template? I couldn't resolve that issue for a month..

I appreciate your help.


--

--
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+unsubscribe@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/0434bba8-9318-40b9-8ca8-ee145b90e293%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment