Comments (2)
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.
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)
- Not working as I expected.. HOT 1
- Different locations for node_modules folder and vue.config.js. HOT 2
- Example with Docker? HOT 1
- Use with vite
- Use in Django Admin templates
- Django apps HOT 4
- `Howto` for multilanguage sites?
- X-Content-Type-Options: nosniff HOT 3
- Easiest way to change config to make an MPA? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-vue-cli-webpack-demo.