Yep, I want it to work like in Flask framework - there I could set parameters like this:
static_folder=os.getcwd()+\"/static/\", static_url_path=\"\"
I believe this is not supported out of the box. Off the top of my head, one way to do it would be with a special 404 handler that, having failed to match against any of the defined URLs, treats the request as a request for a static resource. This would be reasonably easy to do in the development environment but significantly more difficult when nginx, Apache, and/or gunicorn get involved.
In other words, don't do this. Nest your statics (or put them on a different sub domain) but don't mix the URL hierarchy in this way.
This is really easy to accomplish with Nginx using try_files. Using the pseudo-settings below will make Nginx try to find a static file first, and if it fails then execution is passed to your django app.
server {
...
root /some/path/to/assets/;
try_files $uri @django;
location @django {
...
proxy_pass http://unix:/some/path/to/server.sock;
}
}
Example: The file /some/path/to/assets/myfile.ext
will be available as http://mydomain/myfile.ext