Skip to content

Serve MEDIA_ROOT Under a Web Server #62

@elliotmitchum

Description

@elliotmitchum

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions