Wednesday, January 16, 2013

Re: static files, runserver debug=True

On Wed, Jan 16, 2013 at 6:54 AM, Fred Kingham <fredkingham@gmail.com> wrote:
> Can you serve static files like you would in production from the django
> runserver?

it depends on what you mean by "like you would in production":

if you mean "separate processes for static files and web app" then no,
it can't since it's a single server.

if you mean simply serve static files by whatever mechanisms but
keeping the same URLs, then yes. check
https://docs.djangoproject.com/en/1.4/ref/contrib/staticfiles/#django.contrib.staticfiles.templatetags.staticfiles.django.contrib.staticfiles.views.serve
(almost at the end of the contrib/staticfiles doc page). in short,
it simply adds some a view function to handle STATIC_URL from the
files in any directory searchable by collectstatic. note that that
means you don't have to run collectstatic for it to work, it's only
needed for deployment.


--
Javier

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate