thank you eric On Wednesday, June 6, 2018 at 10:22:44 PM UTC+5:30, Eric Pascual wrote: > > Templates contain standard HTML code (or any other text based content) and > template directives, delimited by '{% %}'. They can also contain > placeholders, delimited by '{{ }}', which content is processed and replaced > with the resulting value. The resulting values are basically the ones you > pass using the "template context". You can add filters (after the '|' > symbol) for post-processing the value before injecting it in the template. > > > To answer your precise question, the {% load static %} directive is > inserted at the beginning of your HTML template to instruct the templating > engine that the static resolution mechanism functions are used. > > > All this should be clear if you study Django templates documentation and > the accompanying examples. > > > Eric > ------------------------------ > *From:* django...@googlegroups.com <javascript:> < > django...@googlegroups.com <javascript:>> on behalf of Avitab Ayan Sarmah > <avita...@gmail.com <javascript:>> > *Sent:* Wednesday, June 6, 2018 6:42:51 PM > *To:* Django users > *Subject:* Please give the steps to follow this: > > > 1. > > In your templates, use the static > > <https://docs.djangoproject.com/en/2.0/ref/templates/builtins/#std:templatetag-static> > template > tag to build the URL for the given relative path using the configured > STATICFILES_STORAGE > > <https://docs.djangoproject.com/en/2.0/ref/settings/#std:setting-STATICFILES_STORAGE> > . > > {% load static %}<img src="{% static "my_app/example.jpg" %}" alt="My > image"/> > > 2. > > Store your static files in a folder called static in your app. For > example my_app/static/my_app/example.jpg. > > > How do i use the static template tag?Because in my templates there is only > html files.Where do i add the statement {% load static %}? comment please > > -- > 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 djang...@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/81a53388-6929-4bac-a12e-af9d46724004%40googlegroups.com > > <https://groups.google.com/d/msgid/django-users/81a53388-6929-4bac-a12e-af9d46724004%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/7de230c4-7feb-47c3-8d07-6457410c5bc4%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.