Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making Django development server faster at serving static media

Tags:

python

django

I'm using the Django manage.py runserver for developing my application (obviously), but it takes 10 seconds to completely load a page because the development server is very, very slow at serving static media.

Is there any way to speed it up or some kind of workaround? I'm using Windows 7.

like image 696
Veeti Avatar asked Mar 01 '10 19:03

Veeti


2 Answers

Consider using mod_wsgi instead, and having httpd handle the static media.

like image 195
Ignacio Vazquez-Abrams Avatar answered Oct 06 '22 11:10

Ignacio Vazquez-Abrams


Development server is simple unsafe single-threaded application, so you cannot do much.

One trick you could try is to redirect /site_media to second development server, but this is ugly and probably wouldn't help that much. So you could try bundling/compressing multiple assets into one css/js (e.g. using YUI Compressor).

And in any case, you should have separate static media server, that can serve multiple assets at once.

like image 22
Tomasz Zieliński Avatar answered Oct 06 '22 13:10

Tomasz Zieliński