GithubHelp home page GithubHelp logo

jhottmaster / djando-react-postgresql-docker-template Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 33 KB

Template for a Python Django API app with PostgreSQL and ReactJS/Vite

Dockerfile 8.31% Python 47.24% JavaScript 3.79% HTML 3.18% CSS 15.66% TypeScript 12.55% Shell 9.26%

djando-react-postgresql-docker-template's Introduction

README

Getting started

1.) docker-compose build 2.) docker-compose up -d

Troubleshooting

  • Make sure you run commands with the correct permissions. (e.g. may need to sure with sudo)
  • If you're getting a "port is already allocated" error:
    • Make sure services aren't already running. E.g. run docker-compose down
    • Make sure you don't have any other docker containers running that use the port:
      • sudo docker container ls
      • sudo docker stop [CONTAINER ID]

Notes

How I made this:

python3 -m venv .venv
source .venv/bin/activate
pip install django djangorestframework django-cors-headers psycopg2-binary
django-admin startproject backend
pip freeze > requirements.txt
touch gitignore
code gitignore

.venv/
backend/backend/__pycache__/
backend/db.sqlite3

git init
git add .
git commit -m "Backend"

npm create vite@latest frontend --template react-ts

Select:

  • (y)
  • React
  • Typescript + SWC
cd frontend
npm install
npm run dev

Validate it works; Ctrl + C

cd ../
git add .
git commit -m "Front end"

Then I created the actual containerization; see git history.

References

https://dev.to/anjalbam/dockerize-a-django-react-and-postgres-application-with-docker-and-docker-compose-by-anjal-bam-e0a

djando-react-postgresql-docker-template's People

Contributors

jhottmaster avatar

Stargazers

Nikifor Genchev  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.