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 1061029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:25:00+00:00 2026-05-16T18:25:00+00:00

I’m working on a project where a user can submit a link to a

  • 0

I’m working on a project where a user can submit a link to a sound file hosted on another site through a form. I’d like to download that file to my server and make it available for streaming. I might have to upload it to Amazon S3. I’m doing this in Django but I’m new to Python. Can anyone point me in the right direction for how to do this?

  • 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-16T18:25:01+00:00Added an answer on May 16, 2026 at 6:25 pm

    Here’s how I would do it:

    1. Create a model like SoundUpload like:

      class SoundUpload(models.Model):
          STATUS_CHOICES = (
              (0, 'Unprocessed'),
              (1, 'Ready'),
              (2, 'Bad File'),
          )
          uploaded_by = models.ForeignKey(User)
          original_url = models.URLField(verify_true=False)
          download_url = models.URLField(null=True, blank=True)
          status = models.IntegerField(choices=STATUS_CHOICES, default=0)
      
    2. Next create the view w/a ModelForm and save the info to the database.

    3. Hook up a post-save signal on the SoundUpload model that kicks of a django-celery Task. This will ensure that the UI responds while you’re processing all the data.

      def process_new_sound_upload(sender, **kwargs):
         # Bury to prevent circular dependency issues.
         from your_project.tasks import ProcessSoundUploadTask
         if kwargs.get('created', False):
              instance = kwargs.get('instance')
              ProcessSoundUploadTask.delay(instance.id)
      
      post_save.connect(process_new_sound_upload, sender=SoundUpload)
      
    4. In the ProcessSoundUploadTask task you’ll want to:

      • Lookup the model object based on the passed in id.
      • Using pycurl download the file to a temporary folder (w/very limitied permissions).
      • Use ffmpeg (or similar) to ensure it’s a real sound file. Do any other virus style checks here (depends on how much you trust your users). If it turn out to be a bad file set the SoundUpload.status field to 2 (Bad File), save it, and return to stop processing the task. Perhaps send out an email here.

      • Use boto to upload the file to s3. See this example.

      • Update the SoundUpload.download_url to be the s3 url, the status to be “processed” and save the object.
      • Do any other post-processing (sending notification emails, etc.)

    The key to this approach is using django-celery. Once the task is kicked off through the post_save signal the UI can return, thus creating a very “snappy” experience. This task gets put onto an AMQP message queue that can be processed by multiple workers (dedicated EC2 instances, etc.), so you’ll be able to scale without too much trouble. This may seem like a bit overkill, but it’s really not as much work as it seems.

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

Sidebar

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.