@NdagiStanley has mirrored the fork to have this repo here. This starterpack has proved useful to many and I thank you for the emails I have received from all of you. The reasoning behind this mirror is that; this is an effort to support the users more by developing further on this project. From here on, I am calling on all potential collaborators by making it easier to make PRs and adding the utility of Issues in this 'new' repo (Of course with the same name
�� ). Lastly, just so you know, I'll be keeping up with developments in theoriginal
.
A full-featured Webpack setup with hot-reload, lint-on-save, unit testing & css extraction integrated into a django application
If you are using vue-cli@1.x
, it will be pulling the master
branch of this template by default. If you are using vue-cli@2.x
, it will be pulling the dist
branch instead, which provides more configurable options thanks to new features in vue-cli@2.x
. It is recommended to upgrade vue-cli
as soon as you can.
Common topics are discussed in the docs. Make sure to read it!
https://vuedjango.herokuapp.com/ is a deployed instance of this boilerplate.
Vue-Django Docs offer a more comprehensive documentation.
This is a project template that includes VueJS
and Django
based on the vue-cli templates. It is recommended to use npm 3+ for a more efficient dependency tree.
$ npm install -g vue-cli
You might want to use sudo
if you encounter permissions error
$ vue init NdagiStanley/vue-django my-project # Follow the prompts
$ cd my-project
$ npm install
Run:
$ npm run dev
The app runs on localhost:8080
Update the files as you wish and the hot-reload will take effect. Add js
and css
files within the static
folder in the root directory. Link them to the index.html in that same level (the root directory).
Have Python installed and preferably use a virtual python environment for this.
Run:
$ python -m pip install -r requirements.txt
$ sh server.sh
(Run this command every time you make changes)
At localhost:8000 you should have a page exactly like the image below or as the deployed instance mentioned earlier: https://vuedjango.herokuapp.com/
Docker
If you use docker
in your workflow, there is a Dockerfile
in the root directory for you. Simply run
docker build -t [image-name] .
Use your preferred image name in place of the image-name
in the command. Remember to enter the trailing period before running it.
There is a docker container for vue-django that you can run. Simply run the following command.
docker run -p 8000:8000 stanmd/vue-django
Then get to localhost:8000. You should have a page exactly like the image above
npm run dev
: first-in-class development experience.
vue-loader
for single file Vue components.npm run build
: Production ready build.
index.html
is auto-generated with proper URLs to these generated assets.npm run unit
: Unit tests run in PhantomJS with Karma + Mocha + karma-webpack.
npm run e2e
: End-to-end tests with Nightwatch.
NB: This repo has been forked from vue-webpack-boilerplate to help you start a Django application utilizing the awesomeness of VueJS
and vue-cli
Feel free to contribute to this repo.
To create your own boilerplate, fork this repo or vue-webpack-boilerplate and use it with vue-cli
:
vue init username/repo my-project
Thank you to all our backers!
Django models from django.db import models from django.utils import timezone class File(models.Model): # 文件名称 name = models.CharField(max_length=50) # 文件保存路径 # path = models.CharField
1、权限管理系统演示 1.1 本系统部分内容展示 1.2 本系统中所用到的技术 Vue Elementui Django Rest Framework Mysql LDAP 2、前端项目创建与登陆流程讲解 3、后端项目初始化 3.1 安装基础软件包 3.2 配置settings.py文件 3、后端Django表结构设计 4、后端权限管理序列化与反序列化 5、后端登陆接口与用户信息 6、前端菜单管理
vue <el-form ref="form" :model="form" label-width="80px"> <el-form-item label="商品图片"> <input type="file" @change="getImageFile" id="img"> <img :src="i
1. 前端:在vue-admind-template的基础上写我们的前端代码,对于想要实现的简单的前端组件(表格,弹框,表单等等)先去element组件库里copy,对于想要实现的复杂的前端组件(图表,编辑器)就去vue-element-admin这个项目中copy 2. 后端:使用django来搭建我们的后端,配合django-rest-framework来写接口,5行代码就能完成了一张数据库表
ECharts介绍 ECharts,一个使用 JavaScript 实现的开源可视化库,可以流畅的运行在 PC 和移动设备上,兼容当前绝大部分浏览器(IE8/9/10/11,Chrome,Firefox,Safari等),底层依赖矢量图形库 ZRender,提供直观,交互丰富,可高度个性化定制的数据可视化图表。 安装echart npm install --save echarts 引入echar
背景:vue使用Network进行登录的时候 报错 403,但是在localhost的时候就没问题,进行了一下对比,network header中多了一个cookie,local中就没有,再结合django默认有csrf跨站点请求伪造,翻了翻文档,得知需要在header中添加X-CSRFToken,解决办法如下: 解决办法: 在vue-admin-template utils/request.js
构造器 每个 Vue.js 应用都是通过构造函数 Vue 创建一个 Vue 的根实例 启动的: var vm = new Vue({ // 选项 }) 虽然没有完全遵循 MVVM 模式, Vue 的设计无疑受到了它的启发。因此在文档中经常会使用 vm 这个变量名表示 Vue 实例。 在实例化 Vue 时,需要传入一个选项对象,它可以包含数据、模板、挂载元素、方法、生命周期钩子等选项。全部的选
Django-Vue-Admin 是一套全部开源的快速开发平台,毫无保留给个人及企业免费使用。 前端采用ruoyi-ui 、Vue、Element UI。 后端采用Python语言Django框架。 权限认证使用Jwt,支持多终端认证系统。 支持加载动态权限菜单,多方式轻松权限控制。 特别鸣谢:Gin-Vue-Admin,RuoYi ,Vue-Element-Admin,eladmin-web。
Cookiecutter Django-Vue Powered by Cookiecutter,inspired by Cookiecutter Django. Features Docker 12 Factor Server: Nginx Frontend: Vue + vue-cli + PWA Backend: Django Database: PostgreSQL API: REST or
hello-vue + Django This is a boilerplate project for using vuejs with Django. Features Django backend in ./backend vuejs (v2) frontend in ./frontend Hot-reload with vue-loader eslint linter integratio
教程简介 本教程要实现一个简单的后台管理系统,包含登陆、数据列表、数据查询、列表分页、添加数据、修改数据和删除数据等功能,教程会从 Vue 入门开始讲解,包含 es6、Sass、Webpack、Bootstrap、jQuery 等技术,再到后台管理系统的一些常规功能,用 Vue 如何去实现。 也许会有人质疑 Vue 和 jQuery 的搭配,在我本人看来,jQuery 本身已很成熟,而且包含了很多
FAQ 哇,非常长的一页!是否意味着 Vue 2.0 已经完全不同了呢,是否需要从头学起呢,Vue 1.0 的项目是不是没法迁移了? 非常开心地告诉你,并不是!几乎 90% 的 API 和核心概念都没有变。因为本节包含了很多详尽的阐述以及许多迁移的例子,所以显得有点长。不用担心,你不必从头到尾把本节读一遍! 我该从哪里开始项目迁移呢? 首先,在当前项目下运行迁移工具。我们非常谨慎地把高级 Vue