Django + Vue Template: Standardised CFC Tech Stack
- Activate the dev container in VSCode
- In the
clientfolder, runnpm run devto start the frontend on port atlocalhost:3000 - In the
serverfolder, runpython manage.py runserverto start the server atlocalhost:8000
Note: For manual setup see end of README
If the models are updated, be sure to create a migration:
python manage.py makemigrations # create migration
python manage.py migrate # apply migrationsIf you run into migration conflicts that you can't be bothered to fix, run nuke.sh to clear your database. Then, run migrations again.
You can run npm install and poetry install in the respective client and server folders to install the newest dependencies.
If you modify anything in the docker folder, you need to add the --build flag or Docker won't give you the latest changes.
Edit the .env file in the respective directory (client or server).
Setup environment variables:
- In the
clientfolder, copy the content from.env.exampleinto a new file called.env - In the
serverfolder, copy the content from.env.exampleinto a new file called.env
Run the client:
- In the
clientfolder, runnpm i - Run
npm run dev
Run the database:
- In the project root, run
docker compose up
Run the server:
- In the
serverfolder, runpoetry install. - Start the poetry shell by running
poetry shell - Run migrations using
python manage.py migrate - Start the server using
python manage.py runserverNote: To exit the poetry shell after stopping the server, use the commandexit