Skip to content
/ DjangoReact Public template

Dockerized starter project for PostgreSQL, Django, and ReactJS

Notifications You must be signed in to change notification settings

kwmccabe/DjangoReact

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.