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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:54:57+00:00 2026-06-17T15:54:57+00:00

I am making a Django app which allows users to upload pictures via the

  • 0

I am making a Django app which allows users to upload pictures via the admin interface and then access the URL of those images via an API endpoint. On the admin interface, the user should be presented with the Filepicker.io widget (to enable drag and drop functionality, etc.) and the file should be uploaded to S3. I have already entered my S3 credentials into the Filpicker admin page of my account.

My question is how to bring all these elements together. Here the appropriate files from my project:

# models.py
from django.db import models
from django_filepicker.models import FPFileField

# Add field introspection for FPFileField 
# See http://south.aeracode.org/wiki/MyFieldsDontWork
from south.modelsinspector import add_introspection_rules
add_introspection_rules([], ["^django_filepicker\.models\.FPFileField"])

class Product(models.Model):
    product_logo = FPFileField(upload_to='uploads')

# forms.py
from django import forms
from django_filepicker.forms import FPFileField
from django_filepicker.widgets import FPFileWidget
from example.models import Product

class ProductForm(forms.ModelForm):
    class Meta:
        model = Product

    def __init__(self, *args, **kwargs):
        self.fields['product_logo'] = FPFileField(widget = FPFileWidget)
        super(ProductForm, self).__init__(*args, **kwargs)

# views.py
from django.http import HttpResponse
from example.models import Product
import json

def example_view():
    result = []
    products = Product.objects.all()
    for product in products:
        # I want the S3 URL here!
        result.append(product.product_logo.url)
    return HttpResponse(json.dumps(result, indent=2))

My problems are:

  1. The Django admin interface displays the normal Django FileField widget, whereas I want the FPFileWidget instead
  2. I want the image files to upload to S3 (not the /media directory of my site)
  3. I want to retrieve the S3 URLs not the /media/xxxx URLs.

For example, a typical response is currently this:

[
  "/media/uploads/fp-file", 
  "/media/uploads/fp-file_1", 
  "/media/uploads/fp-file_2", 
  "/media/uploads/fp-file_3", 
  "/media/uploads/fp-file_4", 
  "/media/uploads/fp-file_5"
]

But I want something like:

[
  "https://s3-ap-southeast-2.amazonaws.com/XXXXXXXXX/TBtOcRSNyBAZZuNBFOpA_blah.png", 
  "https://s3-ap-southeast-2.amazonaws.com/XXXXXXXXX/8ODleDuKRIOAglFs0sKl_etc.png", 
]

  • 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-17T15:54:58+00:00Added an answer on June 17, 2026 at 3:54 pm

    You will need to change DEFAULT_STORAGE_BACKEND to an s3 storage backend. Please have a look at amazon-S3 backend of django-storages.

    For using FPFileWidget on admin panel, please have a look at Django Admin: Using a custom widget for only one model field.

    Changing these two settings should work for you.

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

Sidebar

Related Questions

I'm making a Django web-app which allows a user to build up a set
I'm making an app, which requires users to upload some files. I want to
I am making a django app with comments and voting on those comments, in
Django is making very nice forms after creating a models.py and an admin.py. How
I have an apps and I am making used of django admin, but my
I am making a custom form object in Django which has an overrided __init__
I am making a Django Model decorator which takes a Django model and gives
I'm making a threaded forum app using django-mptt. Everything is up and running, but
I'm making a django app that needs to be able to make emails and
I'm making a simple django site, for which I'm using the django-registration extension. I

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.