Jacob Kaplan-Moss wrote:
The point is that serving media from Django is a Bad Idea(tm), and one of the philosophies behind Django is that we want to make it easier to do the right thing than to do the wrong thing. I'm not going to go into why serving media from an application server is bad unless someone really wants to discuss it; just trust me when I say that in the long run you'll be much happier if you take the 30 seconds to set up a static directory or subdomain to serve media from.

That's exactly what I've done, and I understand why this is the sensible thing to do. But it would be useful to be able to run the development (built-in) server completely separately from the production server, yet still see all the relevant media (what the production page would look like).

That said...

It should be very easy to write a "static directory" view; something like the following should get you started::

I didn't actually think much about doing this. If you install that code as part of an application for the development server, won't it insert cruft into the database (specifically, a spurious entry in 'packages')?

Again, this is a BAD IDEA (and looking at the code should start to tell you why), but if you don't care about doing it right the above view should get you started.

Yeah, security flaws agogo. Mind you, I run the dev server on a port that's firewalled to local access only.

Anyway, I see your point, I'm just not sure that it applies in the development environment.

-Andy

Reply via email to