Skip to content

rnvarma/BaseReactDjangoApp

Repository files navigation

Base React-Django App

This is a blank django-backend/react-frontend web application that uses webpack to manage static files. Django-rest-framework is setup so that you can make API requests for data from the frontend. Also, css is being loaded through the javascript require syntax through webpack.

Setup environment

First, setup a python virtualenv (pip install virtualenv) with the following command:

virtualenv name_of_project

Then go into the environment and activate it with the following command (for macs, pcs are something else):

source bin/activate

Now clone the repository into your virtualenv:

git clone https://github.com/rnvarma/BaseReactDjangoApp

Now change into the repository folder for the next steps.

Install dependencies

Run the following commands while your virtualenv is activated and you are in the top level directory of the repository:

sudo pip install -r requirements.txt

npm install

Configure Local Webpack Path (for mac/pc compatability)

Create a file in the top-level called 'mac-pc-compatability.js'.

If you are using a mac, paste the following code into the file: module.exports = "."

If you are using a pc, paste the following code into the file: module.exports = "../.."

Launch Server

To launch server you need to launch the webpack server + django server:

Webpack cmd (MAC):

./node_modules/.bin/webpack --config webpack.config.js --watch

Webpack cmd (PC): first change directories into node_modules/.bin/ and run the following

webpack --config ../../webpack-config.js --watch

Django cmd:

python manage.py runserver

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published