-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File input doesn't show up #244
Comments
I encountered the same error using the latest (2.0.0) release, downgraded to 1.1.8 worked. python 3.10, djanog 3.25, djang-s3direct 1.1.8 |
I think I discovered what is causing this issue. s3direct's script tag is inserted in the head. This means that this part of s3direct's script (the last ~150 chars of
I believe document.body is null at the time it is run which causes the "parameter 1 is not of type 'Node'." I bodged this by putting the script at the end of the body by adding to the admin template. Info in this SO answer. My /templates/admin/base_site.html file:
This fixes the input not showing up problem for me. Hopefully there is a better way to solve this, perhaps jquery's .ready(), javascript's window.onload, or by somehow telling django to put the script at the end of the body (I'm not sure if this is possible using the Media class), or maybe even putting the script in the widget's template. |
Should be fixed in the latest release. |
I'm trying to use django-s3direct on the admin page.
Followed the steps to use the example, but inputs doesn't appear in admin form.
I'm using Python 3.10 and Django 4.0.2
I would like to use django-s3direct in other proyect with the same versions, so I cannot downgrade.
The text was updated successfully, but these errors were encountered: