This is a boilerplate project for using vuejs with Django. Forked from: https://github.com/rokups/hello-vue-django I'll keep this project up-to-date and add useful instructions that might be helpful :-D
- Django backend in
./backend
- vuejs (v2) frontend in
./frontend
- Hot-reload with vue-loader
- eslint linter integration
- Makefile to make your life easy
Run the following command to start a new project, change projectname to your project's name:
django-admin startproject projectname --template https://github.com/timtech4u/hello-vue-django/archive/master.zip
These steps will install all required dependencies including development ones, run migrations and start dev server.
make dev
make migrate
make run
These steps will install productio dependencies and build vuejs application to static/dist
folder.
make prod
make build
For the sake of simplicity Django config is contained within it's own backend app. In real world setting you would
probably want to remove backend
from INSTALLED_APPS
, create a new app and move backend.views
to it.
You probably want to create python virtual environment as well. Default python instance available will be used.
If you'll be building an API endpoint you'll probably need to setup Django Cors...
Full Instructions can be found at: https://github.com/ottoyiu/django-cors-headers
Checkout: https://cssauthor.com/vuejs-frameworks/