Re: what's different between {% static %} and {{ STATIC_URL}}

2015-01-08 Thread Florian Schweikert

On 2015-01-06 12:55, Andreas Kuhne wrote:

The difference is the age of the django project you are looking at. {%
load staticfiles %} the {% static %} is the current way to load and
use static files. It also has the option to do other things (like MD5
hashes for versions) automatically and should be used.


Also {% static %} works with your 500.html
As there is no context accessible if an 500 happen, {{ STATIC_URL }} is 
not available.


-- Florian

--
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/b988a8e0735fca89751cd0f8d0ca45a3%40ist-total.org.
For more options, visit https://groups.google.com/d/optout.


Re: what's different between {% static %} and {{ STATIC_URL}}

2015-01-06 Thread Andreas Kuhne
Hi,

The difference is the age of the django project you are looking at. {% load
staticfiles %} the {% static %} is the current way to load and use static
files. It also has the option to do other things (like MD5 hashes for
versions) automatically and should be used.

If you create a project in the new way, you will also get all of your
static files nicely copied to a static file directory that you can serve
from your webserver automatically. It's the best way to do it.

Regards,

Andréas

2015-01-06 12:23 GMT+01:00 老张 :

> hi,guys
> i'm new to django。when I write my first app, there are 2 options to access
> static files,
> 1 using  {{ STATIC_URL}}
> 2 using  {% load staticfiles%} then {% static %}
> what 's different between the 2 options, and ,when I migrate from
> development to production env
> which one is conveniency ?
> Thanks alot
>
>
>
>  --
> 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/31d5812d.1eba0.14abefc5261.Coremail.paiis314%40163.com
> 
> .
> 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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALXYUbkhxHJnYZ3PS0S2A13ykPW%2BQmbRV%3DVE-S%2Bfo8cDzjJpBQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


what's different between {% static %} and {{ STATIC_URL}}

2015-01-06 Thread 老张
hi,guys
i'm new to django。when I write my first app, there are 2 options to access 
static files,
1 using  {{ STATIC_URL}}
2 using  {% load staticfiles%} then {% static %}
what 's different between the 2 options, and ,when I migrate from development 
to production env
which one is conveniency ?
Thanks alot 
 

-- 
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/31d5812d.1eba0.14abefc5261.Coremail.paiis314%40163.com.
For more options, visit https://groups.google.com/d/optout.