bradleyg / django-s3direct

Directly upload files to S3 compatible services with Django.
MIT License
661 stars 234 forks source link

Admin upload not displaying in Django 3.2 for versions 2+ #253

Open tammyalexandra opened 2 years ago

tammyalexandra commented 2 years ago

In the admin the S3 direct upload form is not showing up -- it should appear in the space to the right of "Local image:" in the screenshot below:

image

All the markup for the element does appear in the source of the page. I discovered that the CSS from /static/s3direct/dist/index.css appears to be hiding it (what you see below is the CSS straight from the file; it was not modified by any JS that ran on the page).

image

Downgrading django-s3direct to 1.1.8 but keeping Django 3.2 restored the functionality of django-s3direct. No version of django-s3direct 2.0 or above works. Working versions suggest that JS runs after the page loads to display the form elements. I am not getting any JS errors in the browser.

I do not have any custom code running in my admin, and I confirmed that all my code and configuration matches the documentation for the newer versions of django-s3direct.

Thanks for any help you can provide untangling this.

bradleyg commented 2 years ago

Does the example work for you? (with Django 3.2). I just tried it and couldn't recreate the issue.

bradleyg commented 2 years ago

Managed to recreate. Could you try again with the latest version?

tammyalexandra commented 2 years ago

Good news -- the form elements now show up and the image successfully gets uploaded. Thank you!

Bad news -- even after the image gets uploaded, the buttons to save the model containing the image are not un-grayed.

Screen Shot 2022-06-17 at 11 34 03 AM

I see a couple messages in the browser console likely related to whatever is happening:

I can confirm that https://s3.us-east-1.amazonaws.com/my/image/path/file.png is the file that was just successfully uploaded, & I can bring up in the image in my browser.

Thanks for your ongoing help with this!