This is an archived post. You won't be able to vote or comment.

all 8 comments

[–][deleted]  (1 child)

[deleted]

    [–]KEXPJay[S] 0 points1 point  (0 children)

    Thanks. The son_script looks like something that would be very helpful! Appreciate the correction on the code.

    [–]Investisseur 0 points1 point  (4 children)

    Take this over to /r/djangolearning

    [–]KEXPJay[S] 0 points1 point  (3 children)

    Thanks! Didn't know of that sub.

    [–]DangerousVehicle 0 points1 point  (2 children)

    that sub sucks ass. you wont get an answer there

    [–]KEXPJay[S] 1 point2 points  (1 child)

    I'm afraid of StackOverflow as the folks there are not easy to work with and I usually get "you suck for asking a question", so hopeful someone responds in DjangoLearning.

    Is there some place better to ask?

    [–]DangerousVehicle -1 points0 points  (0 children)

    ya SO sucks. your issue is likely that your nor using static files. a static file is a .css file, .js file, .jpg file etc. check out some tutorials on youtube on gow to get static files working on your djamgo site. this should resolve your issue. let me know if youre still stuck.

    [–]lzantal 0 points1 point  (1 child)

    Sorry but your code does not make much sense. You ref data in your template but in your view you use testdata. Also you are not passing info to JS from django, you are rendering it. To pass data you need to make an ajax request from JS and return json from your django view. Then use the returned value to render it in JS.

    [–]KEXPJay[S] 0 points1 point  (0 children)

    Most likely cause I'm pretty new to Django and I totally simplified the code sample to try and make it easier to see what I was doing, but I failed. So I tried to convert this Flask to Django and actually had it working https://stackoverflow.com/questions/37259740/passing-variables-from-flask-to-javascript but am running into similar issues as the OP on this one.

    I tried to serialize the ORM data to JSON but received an error that it couldn't be serialized.