Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serve MEDIA_ROOT Under a Web Server #62

Open
elliotmitchum opened this issue Sep 11, 2024 · 0 comments
Open

Serve MEDIA_ROOT Under a Web Server #62

elliotmitchum opened this issue Sep 11, 2024 · 0 comments

Comments

@elliotmitchum
Copy link
Collaborator

elliotmitchum commented Sep 11, 2024

MEDIA_ROOT should only be added to URLs when DEBUG=True. However, as this is a demo - we wanted Django to serve these assets. We should configure MEDIA_ROOT to serve files through a web server. Media is used to serve protected content such as uploaded PDFS, which might not want to live in public_collected which is served by Whitenoise

In a production situation you will want your media to be served from your front end web server (Apache, Nginx or the like) to avoid extra load on the Django/Python process. The MEDIA_URL and MEDIA_ROOT are usually used for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant