django vue javascript integration

43 views
Skip to first unread message

Tomas Garijo

unread,
Mar 1, 2019, 12:36:37 PM3/1/19
to Django users
Hello group,

I have a huge problems to integrate a vue javascript file in one template, only for testing, I'm searching on google but unfortuny I can't find anything.
I have a simple html file and I want to load a code that is in other file, of course this files is a *.js file

The best is attach some file to see the problem

You can see in the html file,  there is some comment code this is a test to see if the javascript code works fine, and this works fine.
But when this javascript code put in other file and load from html file (I'm not sure this will be true) the code doesn't work fine. 


Kinds Regards


html_file.PNG
struct-project.PNG
settings_file.PNG
test_js_file.PNG

Wira Bhakti

unread,
Mar 1, 2019, 12:46:14 PM3/1/19
to django...@googlegroups.com
Maybe you must put your JavaScript file on your static directory...

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/96e67572-ba1a-47e3-9396-38fef2f98c44%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Message has been deleted

Sam W

unread,
Mar 1, 2019, 4:58:26 PM3/1/19
to Django users
Why don't you use Django REST framework ?

Try this :

How to Integrate Vue.js with Django Rest Framework?

Sithembewena L. Dube

unread,
Mar 1, 2019, 5:01:22 PM3/1/19
to django...@googlegroups.com
The issue here appears to be that OP's browser cannot load the .js file as specified in the resource path. I would agree with Wira about checking what the path is and ensuring that the .js file is in the correct location.

Kind regards,
Sithembewena


Sent with Shift

On Fri, Mar 1, 2019 at 11:52 PM Sam W <samc...@gmail.com> wrote:
Why don't you use Django REST framework ?

On Friday, March 1, 2019 at 11:36:37 AM UTC-6, Tomas Garijo wrote:

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

Tomas Garijo

unread,
Mar 4, 2019, 12:23:39 PM3/4/19
to Django users


Hi, the .js file path i think is correct, if I put the file url on browser I can see the code of .js file on browser
Reply all
Reply to author
Forward
0 new messages