This project is based on the official Django Tutorial. But, there are several enhancements:
- The project has been 'dockerized' into three containers :
db
,api
, andweb
. db
runs PostgreSQL on the official postgres image.api
runs Django on the official python image.web
runs ReactJS on the official node image.- Launch containers :
docker-compose up --build
- Connect :
docker-compose exec db psql --username=postgres_user --dbname=django_react
- A
postgresql.conf
file is provided for tuning database parameters.
- Connect :
docker-compose exec api bash
- Some basic Django commands (to run after connecting) are stored in
/app/bin
. (eg,django-migrate.sh
anddjango-createsuperuser.sh
) - "Polls" have been added to the tutorial's "Questions" and "Choices".
- The Admin sections for each type have been extended to better show the model hierarchy.
- The public pages have been cleaned up with Bootstrap.
- API endpoints have been added using Django REST
- Connect :
docker-compose exec web bash
- Look at the
react/README.md
file to get oriented. - The
package.json
file defines theproxy
link to the API/Django container. (see Create React App) - React Router was added for client-side routing.
- React Bootstrap was added for layout.