Re: Serving files in production
On Thu, Apr 11, 2013 at 1:50 PM, Drew Ferguson <drew@afccommercial.co.uk> wrote:
> On Thu, 11 Apr 2013 14:54:50 +0300
> Avraham Serour <tovmeod@gmail.com> wrote:
>
>> you can create a subdomain (static.yourdomain.com) and serve static using
>> that, configure the second webserver to serve this subdomain
>
> OK, but then all static references must be prefixed with the domain in
> templates, etc AND life gets very complicated when trying to develop the
> same site on a development system.
All static references have to be prefixed anyway, the difference is
the prefix contains a domain name.
This is only a problem if you put "/static/app/images.png" in your
templates, and not {% static "app/images.png" %}
I suggest a more thorough reading of the staticfiles docs:
https://docs.djangoproject.com/en/1.5/ref/contrib/staticfiles/
>
> Is the recommendation really addressing a performance issue for high
> traffic sites where Apache WSGI gets overloaded and becomes a bottleneck?
>
I serve my static files from /static/ *and* they are served by a
completely different server - static files are served from a frontend
server that serves static files from disk and proxies dynamic requests
to a number of django backends. There are many approaches that work to
address static file serving.
Cheers
Tom
--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home