0

I like very much sorl-thumbnail library and I want to store image files not in current application (django) server, but to (another) my own file server with webserver for serving static files.

  • Do I have to write custom django storage or not?
  • How can I upload files to remote static file server(s)?
  • What if I have many application (django) servers and many file servers?
  • Is it better to use custom file upload handler? And if not then when is it useful? And if yes then how to use it with sorl-thumbnail?

P.S. I'm not sure what is the right (good) way to do this, because I have not much experience in web programming and Django.

Julian Popov
  • 17,401
  • 12
  • 55
  • 81

2 Answers2

0

Hmm, perhaps I am not answering the question you meant to ask (don't know anything about sorl-thumbnail), but my first instinct is to cut django out of the picture. If you have some separate server which can serve the files up statically, then just deploy that server. Sure your django application will generate links to those images, but as long as you are clear about your URLs, that should be no problem. You can take this approach even with one web server, configure it to pass only some URLs to django, but handle the image URLs directly.

None of this addresses the uploads issue though...

Adrian Ratnapala
  • 5,485
  • 2
  • 29
  • 39
0

I think the answer to this Django: how to serve user-submitted images & thumbnails from separate, multiple servers? question fits your idea.

Because otherwise you can't just upload the file simply to remote machine. Or you will develope your script to upload files to another host by using scp or something like this...

Cheers, Ignas

Community
  • 1
  • 1
Ignas Butėnas
  • 6,061
  • 5
  • 32
  • 47
  • I'm not sure that this approach is good when using sorl-thumbnail library :( I need a solution that can be easy integrated with this library – Julian Popov Apr 15 '11 at 11:18
  • As I understood the problem is totally unrelated with the Django and libraries you want to use at all... In general I see just a problem how to upload files from one machine to another. So you store uploaded files locally and then distribute to the servers you use for media. But Maybe you will find something easier :) – Ignas Butėnas Apr 15 '11 at 11:22
  • The problem is related with Django because Django provide a plugable support for fileupload handling and fileupload form fields. Also custom file storages that make remote files to look like they are local files. I want to use this support because sorl-thumbnail is also using them – Julian Popov Apr 15 '11 at 11:31