This project uses Python3 and Django2. Please use python3
and pip3
for all shell/terminal commands.
- create
apollo
db inpostgres
- create a
sensitive_settings.py
file usingsensitive_settings.example.py
as an example - change directories to react dir:
cd react
- in node:
npm install
- open new terminal, go to root dir and create virtualenv:
virtualenv env
- activate local environment:
. env/bin/activate
- install requirements:
pip3 install -r requirements.txt
- change directories to react dir:
cd react
- in node:
BROWSER=none npm start
- open new terminal, go to root dir and activate local environment:
. env/bin/activate
- run server:
python3 manage.py runserver 8000
- open a browser and go to localhost:8000
Note: react without django will automatically open in localhost:3000 after running npm start
.
Close this window and use localhost:8000 to see react and django together
- change directories to react dir:
cd react
- in node:
npm run build
- open new terminal, go to root dir and activate local environment:
. env/bin/activate
- run server:
python3 manage.py runserver 8000 --settings=control_panel.production_settings
- open a browser and go to localhost:8000
** Make sure you run collectstatic
after you build the js files,
otherwise your webserver won't be able to find the build files.
** Make sure your build generates a webpack-stats.prod.json
file.
If you are deploy by building the files manually, make sure you also
include it when you're copying files from your machine to server.
- change directories to react dir:
cd react
- in node:
npm test