Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8495691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:38:35+00:00 2026-06-10T23:38:35+00:00

According to Django document: it was common to place static assets in MEDIA_ROOT along

  • 0

According to Django document: “it was common to place static assets in MEDIA_ROOT along with user-uploaded files, and serve them both at MEDIA_URL. “

Does that mean everyone could access other people’s uploaded files?
Isn’t it unsafe?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T23:38:36+00:00Added an answer on June 10, 2026 at 11:38 pm

    To answer your question: yes, this would allow everyone to access everybody’s uploaded files. And yes, this is a security risk.

    As a general rule, sensitive files should never be served directly from the filesystem. As another rule, all files should be considered sensitive unless explicitly marked otherwise.

    The origin of the MEDIA_ROOT and MEDIA_URL settings probably lie in Django’s history as a publishing platform. After all, your editors probably won’t mind if the pictures they add to articles can easily be found. But then again, pictures accompanying an article are usually non-sensitive.

    To expand on your question: sensitive files should always be placed in a directory that is not directly accessible by the web server. Requesting those files should only be done through a view class or function, which can do some sensible access checking before serving the file.

    Also, do not rely on obfuscation for sensitive files. For example, let’s use Paulo’s example (see other answer) to obfuscate photo albums. Now my pictures are stored like MEDIA_URL/A8FEB0993BED/P100001.JPG. If I share this link with someone else, they can easily try URLs like MEDIA_URL/A8FEB0993BED/P710032.JPG, basically allowing them to brute-force my entire photo album.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

According to the Documentation using the django.views.static.server() function is: inefficient and insecure. I understand
According to Django's password_reset view, it Allows a user to reset their password by
According to this SO post: How to check the TEMPLATE_DEBUG flag in a django
According to this section in the Django docs I should use {% blocktrans %}
Django 1.2 has brought in some changes in the syndication framework. According to this
I'm using django.views.generic.list_detail.object_detail. According to the documentation the view takes the variable object_id. To
I'm new to django. I have 2 simple objects, lets call them - File
According to The Django Book , Django's templating system supports nested dot lookups: Dot
According to the Django testing docs, the Django client Response object contains 'templates', which
According to the Hyde website , Hyde is based on the Django template engine.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.