This Gist allows to run VueCLI in FastAPI.
- In dev, you will have to launch both servers and use fastAPI for navigation.
- In prod, it will be enough to build VueCLI, and you will have to launch FastAPI only.
The goal of this workflow is to couple vue-cli to Django, in a transparent way in dev and in prod. The hot-reload is active in the backend as well as in the frontend, and the frontend is accessed through Django, from the index page ;)
Note: We also use the router's historical mode, for a more professional integration.
Note²: Do not forget to build the vue-cli project for production!
"""User forms.""" | |
from django import forms | |
from django.contrib.auth import get_user_model | |
from django.contrib.auth.forms import UserCreationForm | |
from django.utils.translation import gettext_lazy as _ | |
User = get_user_model() |
Allows to couple Django and Vue-cli easily, without any plugin or additional library.
Note : Hot Reload is active with this configuration.