Code Monkey home page Code Monkey logo

Comments (2)

chrisamow avatar chrisamow commented on July 19, 2024 1

Ah yes, thanks for that extra reiteration - having it all concise really made it click. (And for some reason I forgot that {% was legit pass through for html already and I was trying to remember what the magic was for it not messing up the vue build. - gah!)

But I understand the bigger picture (independent of the framework) and that is a nice elegant way to do this. I originally came here because django-webpack-loader was giving problems - I think I maybe had a complicated bundling situation messing things up.

Thanks again, I think this is a great pattern to follow for integrating javascript power into django!

from django-vue-cli-webpack-demo.

EugeneDae avatar EugeneDae commented on July 19, 2024

Hi @chrisamow , thanks for feedback! I'm pretty sure it should work with older versions of Django and Vue just fine.

Just to make things clear: Vue or Vue CLI are basically irrelevant here. In fact I'm now using this in a Django project that doesn't have any frontend framework at all. It is all about Webpack, Webpack Dev Server and html-webpack-plugin. You just configure html-webpack-plugin to produce a valid Django template with all necessary Webpack includes/paths baked in, to a Django templates directory. Then you extend the template (via {% extends %}) in other Django templates. Django picks it up when rendering a page. That's it.

The purpose of this repository is to demonstrate how to set it all up for a Vue CLI project, where the Webpack config can only be modified programmatically. But — if you're not using Vue CLI and/or you have direct access to the Webpack config, it's all even easier.

from django-vue-cli-webpack-demo.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.