Sunday, December 30, 2012

Serve static files in production server

Hi all.
in the appfog ML we were fighting again the possibility to serve static file in django without using an external server.
So far AF does not provide a setup of the server to split the server in static and dynamic (django) folders.
so, one of the solution is to use this

# urls.py 
urlpatterns += patterns('', 
url(r'^static/(?P<path>.*)$', 'django.views.static.serve', { 
'document_root': settings.STATIC_ROOT}) 
)

but, is it ok to use this trick in django or will it lead to problems (aka memory problems and stuff like that)?

ciao

--
Stefano

--
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.

No comments:

Post a Comment