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. dbruns PostgreSQL on the official postgres image.apiruns Django on the official python image.webruns 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.conffile 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.shanddjango-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.mdfile to get oriented. - The
package.jsonfile defines theproxylink to the API/Django container. (see Create React App) - React Router was added for client-side routing.
- React Bootstrap was added for layout.