Skip to content

michaelfong2017/django_react_test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

django_react_test

Usage

1. Navigate to the django-react-boilerplate directory

$ cd django-react-boilerplate

2. Set up environment

Conda environment is used and the dependencies are shown in requirements.txt.

  1. Create conda environment, in my case, my environment name is django_react_test_env.
$ conda create -n django_react_test_env python=3.7
$ conda activate django_react_test_env
  1. Install dependencies.
$ pip install -r requirements.txt

3. Run server

$ python manage.py runserver

4. Test

  1. Enter your username at http://127.0.0.1:8000/.
  2. See your username at http://127.0.0.1:8000/api/data/.

Notes for Testing and Development

  1. Navigate to the django-react-boilerplate directory.
$ cd django-react-boilerplate
  1. You may need to run the following lines once.
$ python manage.py makemigrations
$ python manage.py migrate --run-syncdb

or

$ python manage.py makemigrations
$ python manage.py migrate

Whenever you start the server, run the following line to start the development server at 127.0.0.1:8000.

$ python manage.py runserver

When you only change python codes, you do not need to restart the server every time since django offers hot-reload.

  1. Whenever you change your frontend codes such as index.js and index.css, run the following line.
$ yarn build
  1. If you are only developing frontend codes. You can use hot-reload. It is suggested to run the following line to start another development server at localhost:3000. Remember that this server only contains frontend codes.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published