0

I'm trying to develop a Django application that will eventually serve a large media file repository (10's to 100's of GB) that would ultimately be stored on B2 or S3 instead of locally on the server.

For application related static content, I think I understand that you will have a /static/ in your application tree, and a /static/ in your web server tree. When you run python manage.py collectstatic the files are compared, and the web server file tree is updated based on the application file tree.

Since these would ultimately be uploaded by a user, should I instead be thinking of the MEDIA_ROOTand MEDIA_URL settings? These would then be staging areas prior to preparation and upload to B2 or S3.

I've checked these out:

Identical and simple way of serving static files in development and production - is it possible?

Django: Deploying static files in production environment

serving django media (user uploaded) files in production

Serve media files with a static service. Dotcloud

and I feel like they are probably starting down the right path, but there is minimal discussion so I don't know the alternatives.

Are there other approaches I should consider?

Brian
  • 642
  • 7
  • 18

1 Answers1

0

I recommend you to read this Blog post.

You could basically run python manage.py collectstatic only on your development server to push the files to S3. Than you don't need to add the images to your versioning and Django server.

If you want you also want versioning of the images I recommend Git Large File Storage.

ohlr
  • 1,839
  • 1
  • 13
  • 29