Skip to content

Latest commit

 

History

History
29 lines (24 loc) · 1.95 KB

README.md

File metadata and controls

29 lines (24 loc) · 1.95 KB

DjangoReact

This project is based on the official Django Tutorial. But, there are several enhancements:

Docker-Compose

  • The project has been 'dockerized' into three containers : db, api, and web.
  • 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

PostgreSQL

  • Connect : docker-compose exec db psql --username=postgres_user --dbname=django_react
  • A postgresql.conf file is provided for tuning database parameters.

Django

  • Connect : docker-compose exec api bash
  • Some basic Django commands (to run after connecting) are stored in /app/bin. (eg, django-migrate.sh and django-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

ReactJS

  • Connect : docker-compose exec web bash
  • Look at the react/README.md file to get oriented.
  • The package.json file defines the proxy link to the API/Django container. (see Create React App)
  • React Router was added for client-side routing.
  • React Bootstrap was added for layout.