So, my friends, I've made another video about Django and Vue.js integration. But this video is about how to get a production ready code, and this approach doesn't require Django-Webpack-Loader and Webpack-Bundle-Tracker plugins. kzbin.info/www/bejne/aZa3pYmPbMmogM0
@RedEyedCoderClub3 жыл бұрын
What video should I make next? Any suggestions? *Write me in comments!* Follow me @: Telegram: t.me/red_eyed_coder_club Twitter: twitter.com/CoderEyed Facebook: fb.me/redeyedcoderclub Help the channel grow! Please Like the video, Comment, SHARE & Subscribe!
@ivan_inanych2 жыл бұрын
Сразу заметил русский акцент, но не придал значения, но потом увидел, что пользователя зовут Олег)) Олежа, благодарю за видео, познавательно!
@RedEyedCoderClub2 жыл бұрын
Спасибо. Там есть и другое видео без использования дополнительных пакетов вообще.
@novackirr2 жыл бұрын
@@RedEyedCoderClub хорошая работа, олег
@alexpimentelminga65512 жыл бұрын
Could you update the tutorial, using vue + vite + django?, since vue CLI no longer recommends using it and it doesn't work well anymore.
@RedEyedCoderClub2 жыл бұрын
Thanks for the suggestion, I'll think about it
@muhammadhfashaan7581 Жыл бұрын
u are the best
@anonymousghost53843 жыл бұрын
Linux and open source editor you are awesome
@RedEyedCoderClub3 жыл бұрын
Thanks for comment
@tdye4 жыл бұрын
Love your videos! Please keep creating. Are you able to make a video on deploying a Vue + Django project with a fully functional database? Perhaps to Heroku?
@RedEyedCoderClub4 жыл бұрын
Thank you! I'll make this video, but a bit later.
@MarcoAurelio-sv2tk3 жыл бұрын
YOU ARE THE MAN!!! TNX
@RedEyedCoderClub3 жыл бұрын
Thank you!
@jakubschulz43534 жыл бұрын
Cool! I was looking for this!
@jakubschulz43534 жыл бұрын
...but unfortunately it doesn't work for me. Frontend does not work for me. I found that after changing publicPath to '/', localhost in vue works fine, while in django only the header is still loading. Do you have an idea what this might be? I'm using vue 2, maybe that's the problem?
@RedEyedCoderClub4 жыл бұрын
What does it mean "does not work"?
@jakubschulz43534 жыл бұрын
@@RedEyedCoderClub in console of vue project I have: "Failed to load resource: net::ERR_ADDRESS_INVALID" and "0.0.0.0:8080/favicon.ico:1 Failed to load resource: net::ERR_ADDRESS_INVALID" errors
@RedEyedCoderClub4 жыл бұрын
favicon is not a problem as usual. Is the Vue object rendered on the Django's page?
@jakubschulz43534 жыл бұрын
@@RedEyedCoderClub as I wrote, only the header is loaded
@saxon51152 жыл бұрын
Will this work to add django to a current project that I have in vue?
@RedEyedCoderClub2 жыл бұрын
It should work. Consider watching also this video about Django and Vue integration: kzbin.info/www/bejne/aZa3pYmPbMmogM0 It's a different approach to do it.
Hi, sadly I couldn't make it work. For example: config.devServer didn't allow "hotOnly" or "public" Could you share the version numbers of all necessary js/py libraries?
@RedEyedCoderClub2 жыл бұрын
Check your code please, also there is another video about Django and Vue integration with a different approach
@jpongthep2 жыл бұрын
@@RedEyedCoderClub I get same error. My vue.config.js already contain the existing code as follow. const { defineConfig } = require('@vue/cli-service') module.exports = defineConfig({ transpileDependencies: true })
@rishabhprajapati84232 жыл бұрын
watchOptions isn't a property of devServer as well
@RedEyedCoderClub2 жыл бұрын
@@rishabhprajapati8423 Consider watching of my another video about Vue and Django integration: kzbin.info/www/bejne/aZa3pYmPbMmogM0 It's a different approach, but it's a completely working idea. Was tested in another video about Deploy Django on server: kzbin.info/www/bejne/in3LnKCOo9Kaq6s
@zalderac49002 жыл бұрын
@@rishabhprajapati8423 I made it work with changing it into a dictionary with the same options. Like it was shown in the error message
@subhajitkarmakar5584 жыл бұрын
I am getting OSError:Error reading F:\worknpractice\django_python_stuffs\project\djangovue\frontend\webpack-stats.json. Are you sure webpack has generated the file and the path is correct?
@RedEyedCoderClub4 жыл бұрын
Are you sure webpack has generated the file and the path is correct? Check your code please. And especially all paths.
@vkashpoudel87714 жыл бұрын
@@RedEyedCoderClub same problem with me aswell. I did as you tought us but finally i am getting [Exception Type:OSError] please help me for this problem.
@RedEyedCoderClub4 жыл бұрын
Check your code, please
@shuaibb.a.79624 жыл бұрын
You are probably using latest version, downgrade to @0.4 as explained in this video then go back to your frontend and remove directory DIST/
@mrgriboman3712 жыл бұрын
I'm facing the following issue "Error reading /app/frontend/webpack-stats.json. Are you sure webpack has generated the file and the path is correct?" As far as I can see 'webpack-stats.json' isn't being generated at all (or maybe it is, in some weird place). What can be the problem?
@RedEyedCoderClub2 жыл бұрын
Check your code please. Also there is another video about Django & Vue.js integration without using of django-webpack-loader. kzbin.info/www/bejne/aZa3pYmPbMmogM0
@heljhumenad2 жыл бұрын
is it need to run both runserver for django and npm run for vue side to run the entire project?
@RedEyedCoderClub2 жыл бұрын
No, the idea of the video is to show how to use Vue.js as a static frontend for Django.
@Alik22023 жыл бұрын
all done and i'm getting error saying 'expected string or bytes-like object'. Can you pls answer ?
@RedEyedCoderClub3 жыл бұрын
Please, check your code attentively. Also I think that it's better to use this version of integration: kzbin.info/www/bejne/aZa3pYmPbMmogM0 How to deploy it on server: kzbin.info/www/bejne/in3LnKCOo9Kaq6s
@bishwobhandari51324 жыл бұрын
when i added a routing in vue js app. The django server is not serving those urls. have you tried yet? how to handle routing in vue js in the django server?
@RedEyedCoderClub4 жыл бұрын
You have to make a request from Vue to the URLs have been described in urls.py. Routing in Vue is for Vue, not for Django. Django reacts only on requests, that are passed through routers in urls.py files.
@Wurstfinger-rl1zi3 жыл бұрын
Doesn't work for me. Always getting a blank page no matter how many times I re-do everything... the app.js just cannot be found.
@RedEyedCoderClub3 жыл бұрын
Check your code again!
@krukru45003 жыл бұрын
"Error during template rendering In template C:\Users\Victory\Desktop\djangovuejs\djangovue\templates\index.html, error at line 9" I have such an error comes out at the end when starting the server, help, what can it be?
@chanjack3 жыл бұрын
I met the same error. Did you fix it?
@krukru45003 жыл бұрын
@@chanjack as I understood this is a compatibility problem, I reinstalled python and the libraries were installed, plus the libraries need to be installed via cmd, and not via ide cmd
@RedEyedCoderClub3 жыл бұрын
It's better to use this version: kzbin.info/www/bejne/aZa3pYmPbMmogM0 how to deploy it on a server: kzbin.info/www/bejne/in3LnKCOo9Kaq6s
@felix30ua4 жыл бұрын
Олег, спасибо! А если frontend после build, как подключить эти файлы?
@RedEyedCoderClub4 жыл бұрын
I can't explain it in comments.
@felix30ua4 жыл бұрын
@@RedEyedCoderClub можно в видеоролике)
@RedEyedCoderClub4 жыл бұрын
it'll be the next video.
@RedEyedCoderClub4 жыл бұрын
@@felix30ua I've made the video about it - kzbin.info/www/bejne/aZa3pYmPbMmogM0
@MedievalChips4 жыл бұрын
Hey, what about vue fetch tried that before?
@RedEyedCoderClub4 жыл бұрын
Not sure that got your question correctly. Can you elaborate more?
@MedievalChips4 жыл бұрын
@@RedEyedCoderClub Similar to Axios there is a fetch api for VueJs that can make get,post,delete requests. So you can just attach vue library and write request with fetch data over http like we used to do with jQuery
@RedEyedCoderClub4 жыл бұрын
Of course I know about the fetch() function. And I had written two videos with it: kzbin.info/www/bejne/rnK4gHZqe82VY9E kzbin.info/www/bejne/bXi6fKlmaLSmm80 But this video is about "integration" of Vue to Django, about how to make them work together like a single app.
@MedievalChips4 жыл бұрын
@@RedEyedCoderClub Great, I will check them out. I was just wondering which approach do you think is better the Axios/fetch way or integration with this webpack. I am currently also looking into graphene. Maybe a mix of api, fetch and django views? What do think? P.S. love the videos you are making, exactly what I am interested in. Пока!
@captainmujheri4 жыл бұрын
Hey, can you plz make a video on How deploy this on a server.
@RedEyedCoderClub4 жыл бұрын
Thanks for your suggestion
@bishwobhandari51324 жыл бұрын
I was going to ask the same thing. right now my dev server is working. Django is serving the Vue application. but when I build Vue files for production and have Django serve static file, I am having difficult time. it would be nice if you make one for that and deploy in like a Linux server or something.
@RedEyedCoderClub4 жыл бұрын
it'll be the next video. To be exactly it'll be the video about how to get bundled static files (from npm run build) working with Django project. The result - the production ready Django project.
@captainmujheri4 жыл бұрын
@@RedEyedCoderClub ahh, I am waiting for that, and thanks for your efforts :)
After I set my vue.config.js my app is stop working
@RedEyedCoderClub3 жыл бұрын
What doesn't mean stop working? Also there is another video about Django + Vue integration, that doesn't require to use any Django packages.
@deki90to3 жыл бұрын
'str' object has no attribute 'joinpath'
@RedEyedCoderClub3 жыл бұрын
That's right. In Django 3 BASE_DIR is an instance of the Path class, not str. Check your code.
@gmartinsfilho3 жыл бұрын
video muito, muito bom
@RedEyedCoderClub3 жыл бұрын
Thank you!
@billy-cg1qq3 жыл бұрын
How do I know that this is the right and the easiest way of doing it? He's a Russian computer scientist.
@RedEyedCoderClub3 жыл бұрын
the approach has some flaws, but there is another video: kzbin.info/www/bejne/aZa3pYmPbMmogM0
@billy-cg1qq3 жыл бұрын
@@RedEyedCoderClub God damn it. I hate web development and all the tools needed to just set up a frontend and a backend. it's not supposed to be that complicated all I need is something to interact with and a place to store my data. It has not to be that complicated.
@RedEyedCoderClub3 жыл бұрын
There's an opinion that having two apps is the right way to do it. One app is the Django app, and the other - a Vue app. We have to use Django Rest Framework to return JSON objects, and the Vue side requests for them with fetch() or axios.js library. Also we host them separately too. This approach (kzbin.info/www/bejne/aZa3pYmPbMmogM0) is a bit easier. We have no need in DRF, and two apps, we can use Webpack and Vue.js components. As you know - all approaches have their own pros and cons.
@ивансмирнов-г5л4 жыл бұрын
are you from Russia...??
@RedEyedCoderClub3 жыл бұрын
yep
@spicemasterii67753 жыл бұрын
Why not just use NodeJS instead of Django?
@blabla-kk8bl3 жыл бұрын
if you are ready to invent every think yourself then use node. Django has stable libraries whic node has nothing stable like django one. ex. stripe subs., user management ....
@RedEyedCoderClub3 жыл бұрын
Exactly!
@spicemasterii67753 жыл бұрын
Thank you both! Looks like learning Django is worth the effort.