kryptojenix
kryptojenix

Reputation: 13

Problem loading wasm data for SciChart in Django - scichart2d.data = 404

I can only load a blank SciChart surface with a "loading... spinner". Firefox console says:

Uncaught Error: Internal Server Error : http://127.0.0.1:8000/charts/scichart/scichart2d.data

Django is serving scichart2d.wasm correctly, but not scichart2d.data (which is in the same static dir) My HTML and javascript seem to be working, the Webpack bundle loads and logs to console.

I followed the SciChart tutorial here.

I don't know where this problem is coming from. Is it Webpack, Django, or SciChart?

Here's the Django terminal output:


System check identified no issues (0 silenced).
February 14, 2024 - 01:14:59
Django version 5.0.2, using settings 'core.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

[14/Feb/2024 01:15:03] "GET /charts/scichart/ HTTP/1.1" 200 7752
[14/Feb/2024 01:15:03] "GET /static/bundle.js HTTP/1.1" 200 5155989
[14/Feb/2024 01:15:03] "GET /static/js/bootstrap.bundle.min.js.map HTTP/1.1" 304 0
Not Found: /charts/scichart/scichart2d.data
[14/Feb/2024 01:15:04] "GET /charts/scichart/scichart2d.data HTTP/1.1" 404 3985
[14/Feb/2024 01:15:04] "GET /static/scichart2d.wasm HTTP/1.1" 304 0

I tried intercepting the request for '/charts/scichart/scichart2d.data' in Django:

charts/urls.py

from .views import scichart, sciChartData,
urlpatterns = [
    path("scichart/", scichart, name="scichart"),     
    path('scichart/scichart2d.data', sciChartData, name="sciChartData")
]

charts/views.py

def sciChartData(request):
    print(request)
    dataURL = static('scichart2d.data')
    return FileResponse(open(dataURL,'rb'),
        filename='scichart2d.data',
        as_attachment=True,
        )

but I couldn't successfully return the .data file to SciChart. The print(request) is

<WSGIRequest: GET '/charts/scichart/scichart2d.data'>

Python Version 3.11.2 pip: Django Version: 5.0.2 node: scichart version": 3.3.567

Upvotes: 0

Views: 81

Answers (0)

Related Questions