Re: Serving static/dynamic files under same suburl

2011-06-27 Thread Jani Tiainen
And I think pretty much any webserver can do that. But now, how to do that in development when using built-in runserver command? On Jun 27, 5:33 pm, Mick wrote: > Nginx can test to see if a file is available, and if it exist load that > instead of proxying the request to

Re: Serving static/dynamic files under same suburl

2011-06-27 Thread Mick
Nginx can test to see if a file is available, and if it exist load that instead of proxying the request to django. location / { alias /var/www/static/; if (!-f $request_filename) { proxy_pass http://127.0.0.1:8000; } } Now if /var/www/static/foo.js exists, but /var/www/static/bar.js does not

Re: Serving static/dynamic files under same suburl

2011-06-27 Thread Jani Tiainen
Apparently I didn't made myself clear enough. So let me clarify: I have two files that must be accessed using following urls: /myapp/views/foo.js /myapp/views/bar.js foo.js is a static file and can (and should) be served by using static serving, like webserver. bar.js instead is a file that

Re: Serving static/dynamic files under same suburl

2011-06-27 Thread Shawn Milochik
This can (and probably should) be handled by your Web server. For example, in nginx you may be serving the Django app with something like this: location / { proxy_pass http://127.0.0.1:8400; } And for static content nginx may direct the request elsewhere. This example

Serving static/dynamic files under same suburl

2011-06-27 Thread Jani Tiainen
For example ExtJS 4 introduced new MVC app model. One of the features and slight drawback is quite strict directory structure. Now in most cases I can put files as static but there are occassions when I would like to leverage power of Django templates, namely some translations and urls So for