This repository servers as a template for creating React.JS - Django Web Applications. Note that the Django SECRET_KEY is being exposed here. Please create an entirely new project when starting your actual project. Django SECRET_KEY is used to provide crypthographic signature and it is unique between all Django instances.
Tree below shows the file system for the more important files for this application.
project_root
|_frontend
    |_src
        |_App.js
        |_index.js
        |_store.js
        |_Components
        |_Actions
        |_Reducers
        |_Constants
        |_Screens
    |_public
        |_index.html
    |_package.json
    |_.gitignore
|_backend
    |_manage.py
    |_backend
        |_settings.py
        |_urls.py
    |_base
        |_views.py
        |_urls.py
        |_models.py
        |_admin.py
    |_requirements.txt
|_pyenv
- Set Up
- Running the Application
Clone this repository to your local computer
git clone https://github.com/peanutsee/reactjs-django-boilerplate.gitStart Python virtual environment in the directory you cloned the repository to
virtualenv pyenvStart virtual environment
cd pyenv/Scripts
activateDownload dependencies in requirements.txt
cd backend
pip install -r requirements.txtDownload dependencies in package.json
cd frontend
npm installStart Python virtual environment
cd pyenv/Scripts
activateStart backend server
cd backend
python manage.py runserverStart frontend server (separate terminal/command promopt)
npm run startSave backend dependencies in requirements.txt
pip freeze >> requirements.txtSave frontend dependencies in package.json (installation)
npm install --save <PACKAGE_NAME>Save frontend dependencies in package.json (when you forget to --save during installation)
npm init