Django + Vue Template: Standardised CFC Tech Stack
- Activate the dev container in VSCode
- In the
client
folder, runnpm run dev
to start the frontend on port atlocalhost:3000
- In the
server
folder, runpython manage.py runserver
to 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 migrations
If 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
client
folder, copy the content from.env.example
into a new file called.env
- In the
server
folder, copy the content from.env.example
into a new file called.env
Run the client:
- In the
client
folder, runnpm i
- Run
npm run dev
Run the database:
- In the project root, run
docker compose up
Run the server:
- In the
server
folder, runpoetry install
. - Start the poetry shell by running
poetry shell
- Run migrations using
python manage.py migrate
- Start the server using
python manage.py runserver
Note: To exit the poetry shell after stopping the server, use the commandexit