Comments (4)
Should be fixed in the latest release.
from django-s3direct.
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
from django-s3direct.
Form page doesn't work either.
And I'm getting this error on the browser console.
from django-s3direct.
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 /static/s3direct/dist/index.js
, prettified) is run before the page is fully loaded.
...
new MutationObserver((function(t) {
[].forEach.call(document.querySelectorAll('.s3direct'), A)
}))
.observe(document.body, {
childList: !0,
subtree: !0
})
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:
{% extends 'admin/base_site.html' %}
{% load static %}
{% block footer %}
<div id="footer"></div>
<script src="/static/s3direct/dist/index.js"></script>
{% endblock %}
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.
from django-s3direct.
Related Issues (20)
- Is transfer acceleration supported?
- File inputs overlap with labels in multiple fields forms
- media files not accessible after added the AWS_S3_ENDPOINT_URL
- Add a way to mock s3 for development HOT 4
- [Violation] 'DOMNodeInserted' consider using MutationObserver HOT 1
- Closing out, if this is still an issue feel free to reopen.
- FIle upload works in Admin panel but not through ModelForm
- How Could I Attach MetaData to the S3 Object (file) being Uploaded? HOT 1
- presigned url
- document.body doesn't exist yet when calling oberver.observe HOT 2
- x-amz-content-sha256 not in SignedHeaders
- File Widget not showing in admin panel HOT 3
- Admin upload not displaying in Django 3.2 for versions 2+ HOT 3
- s3direct should validate the path of the uploading file matches the server-generated key on server side
- Please allows to paste image from clipboard to file input in Django Admin
- Is there a way to separate the displayed filename and key value?
- Quick Yes/No Question: Does this package require enabling ACLs on the bucket?
- there is no way to know if error when uploading a file
- Still maintained?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-s3direct.