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

  • Home
  • SEARCH
  • 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 1066377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:00:17+00:00 2026-05-16T20:00:17+00:00

I am prototyping a Django web-app that will provide a static media files (PDFs,

  • 0

I am prototyping a Django web-app that will provide a static media files (PDFs, movies and so on) to the users. One of the features I am going to implement is a dynamic URLs. The point is to generate different URLs for each access attempt. When user will request a list of files I will generate links and save them to the DB. When some of these links will be clicked I will return required content and clear links from the DB.

I suppose that serving media through the Django is far away from the best practices. Should it be avoided at all costs? Does it seems reasonable to access these files via non-Django app (Perl script or something)?

  • 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-05-16T20:00:17+00:00Added an answer on May 16, 2026 at 8:00 pm

    I think the question is wrongly stated.

    Django is capable to serve static files, but by default it is disabled on production, and it is clearly stated it is just for development purposes.
    So, everybody agrees that using django to serve static files is a bad idea 🙂

    However, as you put it, you do not want to use django for serving static files, you want to use django to implement some kind of “security” on file download.
    As I understand it, the file is not static at all; on the contrary, it is definitely dynamic!

    I think you have two possible options:

    • Use django to parse the URL, and then redirect to another server (e.g. nginx) for serving the file. This is for sure the fastest way, but it has the obvious disadvantage of giving away the “real” address of the file.
    • Use django to parse the URL, and then serving the PDF directly. It completely implements your original requirement (one-time URLs) but scaling up on performance could be quite difficult.

    I think the second point needs some more details.
    Serving a file requires some time; using django to serve it is not less efficient than any other method (most of the time is spent in waiting for the I/O), but it may consume a thread, or a process on your server.
    If you plan to have many connections at the same time, this approach may have serious drawbacks; on the other hand, if you need to serve small files to a limited audience, then it may be completely OK.

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

Sidebar

Related Questions

I'm designing a web application - prototyping and wireframing the main pages so I've
I would like to hack around the Android default Settings app for prototyping purposes.
The question says it all, we know most of the hosted web-based UI prototyping
I want rapid prototyping: Quickly define screens, links, buttons etc. I want to easily
I am prototyping Protobuf-net to replace some of our existing C# code which is
I've used Yahoo Pipes for some prototyping, but I'm unwilling reluctant to use it
I'm interested in doing rapid app development in Python. Since this is mainly for
A little while ago I read a great article which described a number of
I've run into a problem where I cannot stop mnesia within my program without

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.