Modern Django App with React

Revision as of 07:30, 9 February 2021 by Bpopp (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Install NPM (you likely already have it)

sudo apt-get install nodejs npm

Install Django

pip install django
pip install django-compressor django-compressor-toolkit

Start the app

django-admin startproject project

Run the app

cd project
python manage.py runserver

Init Git

git init

Init NPM (creates package.json)

npm init

Modify package.json and add to the root:

"dependencies": {
    "babel": "^6.23.0",
    "react": "^17.0.1",
    "react-dom": "^17.0.1"
  },
"devDependencies": {
    "autoprefixer": "^7.1.2",
    "babel-preset-es2015": "^6.24.1",
    "babelify": "^7.3.0",
    "browserify": "^14.4.0",
    "node-sass": "^4.5.3",
    "postcss-cli": "^4.1.0"
  }

Now install everything

npm install