This repo contains a sample application for a node front-end that calls a Django REST Framework API and uses a PostgreSQL database.
It was built for a DjangoCon 2019 talk.
- Slides: View in Browser, Download
- Video - Video
Pre-requisites:
Clone the repo and open the workspace:
git clone https://github.com/qubitron/django-react-devcontainer
cd django-react-devcontainer
code .
Click the "Reopen in Container" button on the popup that appears, after it loads VS Code is running in the container!
To build the front-end, open a new terminal using Ctrl-Shift-`
and run:
cd frontend
npm install
npm start
To run the Django back-end open a new terminal using Ctrl-Shift-`
and run:
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver 0.0.0.0:8000
You may be interested to check out some of the additional links for more information:
- Developing inside a container on a remote docker host
- Django Webpack Loader, for another way to serve up webpack from Django
- Django Docker tutorial from Lincoln Loop, with some advanced & useful features
- Deploying Containers to Azure App Service with VS Code
- Create a PostgreSQL database in Azure